-
-
Save btm/154621 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
About the test system (debian5test): | |
$ cat /etc/debian_version | |
5.0.2 | |
$ dpkg -l stompserver libnet-stomp-perl perl ruby | |
ii libnet-stomp-perl 0.34-1 A Streaming Text Orientated Messaging Protocol Client | |
ii perl 5.10.0-24 Larry Wall's Practical Extraction and Report Language | |
ii ruby 4.2 An interpreter of object-oriented scripting language Ruby | |
ii stompserver 0.9.9-1 a stomp messaging server implemented in ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Net::Stomp; | |
my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613' } ); | |
$stomp->connect(); | |
$stomp->send({ destination => '/queue/foo', body => "TEST" } ); | |
$stomp->disconnect; | |
$stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613' } ); | |
$stomp->connect(); | |
$stomp->subscribe( | |
{ destination => '/queue/foo', | |
'ack' => 'client', | |
'activemq.prefetchSize' => 1 | |
} | |
); | |
$stomp->disconnect; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Net::Stomp; | |
my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613' } ); | |
$stomp->connect(); | |
$stomp->subscribe( | |
{ destination => '/queue/foo', | |
'ack' => 'client', | |
'activemq.prefetchSize' => 1 | |
} | |
); | |
while (1) { | |
my $frame = $stomp->receive_frame; | |
print $frame->body . "\n"; | |
$stomp->ack( { frame => $frame } ); | |
} | |
$stomp->disconnect; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
receive_data: "CONNECT\n\n\000" | |
Connecting | |
Sending frame CONNECTED | |
session:wow | |
receive_data: "SEND\ndestination:/queue/foo\n\nTEST\000" | |
Sending a message to /queue/foo: | |
receive_data: "DISCONNECT\n\n\000" | |
Polite disconnect | |
"Unbind called" | |
Disconnecting | |
receive_data: "CONNECT\n\n\000" | |
Connecting | |
Sending frame CONNECTED | |
session:wow | |
receive_data: "SUBSCRIBE\nactivemq.prefetchSize:1\nack:client\ndestination:/queue/foo\n\n\000" | |
Subscribing to /queue/foo | |
Sending destination backlog for /queue/foo | |
Sending frame MESSAGE | |
message-id:debian5test-1248385938-138925-1 | |
destination:/queue/foo | |
TEST | |
receive_data: "CONNECT\n\n\000" | |
Connecting | |
Sending frame CONNECTED | |
session:wow | |
receive_data: "SUBSCRIBE\nactivemq.prefetchSize:1\nack:client\ndestination:/queue/foo\n\n\000" | |
Subscribing to /queue/foo | |
Sending destination backlog for /queue/foo | |
Sending frame MESSAGE | |
message-id:debian5test-1248386040-221828-3 | |
destination:/queue/foo | |
TEST | |
receive_data: "ACK\nmessage-id:debian5test-1248386040-221828-3\n\n\000" | |
Acking debian5test-1248386040-221828-3 | |
Sending a backlog | |
Nothing left | |
receive_data: "DISCONNECT\n\n\000" | |
Polite disconnect | |
"Unbind called" | |
Disconnecting | |
receive_data: "DISCONNECT\n\n\000" | |
Polite disconnect | |
"Unbind called" | |
Disconnecting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment