W/o Durability
use Net::STOMP::Client; $stomp = Net::STOMP::Client->new(host => "localhost", port => 61613); $stomp->connect(); $stomp->subscribe(destination => "/topic/SampleTopic", ack => "auto"); $stomp->message_callback(sub { printf("%s\n", $_[1]->body()); }); $stomp->wait_for_frames(); $stomp->disconnect();
W/ Durability
use Net::STOMP::Client; $stomp = Net::STOMP::Client->new(host => "localhost", port => 61613); $stomp->connect("client-id" => "SampleClient"); $stomp->subscribe(destination => "/topic/SampleTopic", ack => "auto", "activemq.subscriptionName" => "SampleSubscription"); $stomp->message_callback(sub { printf("%s\n", $_[1]->body()); return 0; }); $stomp->wait_for_frames(); $stomp->disconnect();