activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jourzua <jose.ur...@gmail.com>
Subject Re: Durable/Persistant topics via Stomp on 5.0 snapshot
Date Fri, 30 Nov 2007 19:21:21 GMT

Hi

I'm using "persistent" instead of "persist" and it works fine:

 $stomp->send( { destination => '/topic/foo', body => 'test message',
persistent => 'true' } );

and I'm using postgres persistenceAdapter and
apache-activemq-5.0-20071128.111935-4


__Tango wrote:
> 
> Hi folks.  I'm a bit of a newbie to activemq.  I've been trying both the
> 4.1.1 and 5.0 snapshot (20071120.092745).  I was wondering if the method
> for specifying persistant/durable topic publishing or subscribing has
> changed in 5.0.  
> 
> I have the following test perl code using Net::Stomp
> 
>   #publisher
>   use strict;
>   use warnings;
>   use Net::Stomp;
>   my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613'
> } );
>   $stomp->connect( { login => 'hello', passcode => 'there' } );
>   $stomp->send( { destination => '/topic/foo', body => 'test message',
> persist => 'true' } );
>   $stomp->disconnect;
> 
> And the following consumer:
> 
>   # subscribe to messages from the topic 'foo'
>   use strict;
>   use warnings;
>   use Net::Stomp;
>   my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613'
> } );
>   $stomp->connect (
>       { 
>           login => 'hello',
>           passcode => 'there' ,
>           'client-id' => 'tango',
>       }
>   );
>   $stomp->subscribe(
>       {   destination             => '/topic/foo',
>           'ack'                   => 'client',
>           'activemq.prefetchSize' => 1,
>           'activemq.subscriptionName' => 'tango',
>       }
>   );
>   while (1) {
>     my $frame = $stomp->receive_frame;
>     warn $frame->body; # do something here
>     $stomp->ack( { frame => $frame } );
>   }
>   $stomp->disconnect;
> 
> On activemq 4.1.1, the subscription is durable/persistent (i can
> disconnect the consumer and any messages sent by the producer will be
> received by the consumer when the consumer is reconnected).  However, on
> the 5.0 snapshot, i cannot get any messages that are sent by the producer
> when the consumer is offline to be received by the consumer when the
> consumer is reconnected.  
> 
> Is there a configuration or setup option that has changed in 5.0 that will
> make this work?
> 
> Thanks.
> 
> -Tango
> 

-- 
View this message in context: http://www.nabble.com/Durable-Persistant-topics-via-Stomp-on-5.0-snapshot-tf4880188s2354.html#a14079800
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message