Skip to content

Instantly share code, notes, and snippets.

@btm
Forked from jtimberman/about.txt
Created July 24, 2009 23:57
Show Gist options
  • Save btm/154621 to your computer and use it in GitHub Desktop.
Save btm/154621 to your computer and use it in GitHub Desktop.
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
#!/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;
#!/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;
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