activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From welly <we...@regentmarkets.com>
Subject Net::Stomp (retroactive subscription for activemq)
Date Thu, 21 Jan 2010 11:02:07 GMT

All,
 I would like to use Apache Activemq + Net::Stomp. 

The module works great for durable subscription , 
everything is working fine, then I am trying to use retroactive
subscription, 
but i always cant get the previous messages. I am sure i am doing some 
mistake or misunderstand something. Would you mind to help me out ?

The codes
======

x.pl

use Net::Stomp;
my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613' } );
$stomp->connect( { login => 'hello', passcode => 'there' } );
while(1)
{
$stomp->send(
    {
      destination => '/topic/welly', 
      body => time(),
#       persistent => 'true'
    } 
);

sleep(1);
}
$stomp->disconnect;

------------------------------------------------------------------------------------------------------

y.pl

use Net::Stomp;
my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613' } );
$stomp->connect(
    {
      'login' => 'hello',
      'passcode' => 'there',
#       'client-id' => 'tango',
    } 
);
$stomp->subscribe(
    {
        'ack'                   => 'client',
        'destination' => '/topic/welly',
#         'activemq.prefetchSize' => 1,
        'activemq.retroactive' => 'true',
        'activemq.maximumPendingMessageLimit' => 10,
#         'activemq.subscriptionName' => 'tango',
    }
);
while (1) {
  my $frame = $stomp->receive_frame;
  warn $frame->body;
  $stomp->ack( { frame => $frame } ); 
}
$stomp->disconnect;
------------------------------------------------------------------------------------------------------


Thanks

Welly
-- 
View this message in context: http://old.nabble.com/Net%3A%3AStomp-%28retroactive-subscription-for-activemq%29-tp27256067p27256067.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message