# Loan broker test - Robin Bramley, Opsera Ltd
use Net::Stomp;
# set up connection
my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61626' } );
$stomp->connect( { login => 'smx', passcode => 'smx' } );
# subscribe to output channel
$stomp->subscribe(
{ destination => '/queue/demo.org.servicemix.output',
'ack' => 'client',
'activemq.prefetchSize' => 1
}
);
# send to source channel
$stomp->send(
{ destination => '/queue/demo.org.servicemix.source',
body => 'test message',
'ssn'=>'012-24932-53254',
'amount'=>12345.12,
'duration'=>36,
'reply-to'=>'/queue/demo.org.servicemix.output',
'correlation-id'=>'111111456' } );
# pick up the response
my $frame = $stomp->receive_frame;
print $frame->as_string;
$stomp->ack( { frame => $frame } );
# disconnect
$stomp->disconnect;