use Net::Stomp; my $hostname = 'localhost'; warn "Creating stomp object"; my $stomp = Net::Stomp->new( { hostname => $hostname, port => '61613' } ); warn "Connecting"; $stomp->connect( { login => 'guest', passcode => 'password' } ); warn "Subscribing"; $stomp->subscribe( { destination => '/queue/example.A', 'activemq.prefetchSize' => 1 }); while ( $stomp->can_read ){ warn "Getting frame"; my $frame = $stomp->receive_frame ( { timeout => 0.5 } ) || die 'frame timeout'; warn 'Got frame: ' . $frame->body; } $stomp->disconnect; warn "Disconnected";