You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Eugene79 <sp...@yahoo.com> on 2008/09/03 04:02:54 UTC
persistence not working
Hi,
I am investigating ActiveMQ as a message broker solution for our
application. I set it up on my machine and tried sample ruby programs. So
far it works fine when there is both a publisher and subscriber running.
However, what I want to do is make sure that messages can be delivered even
if the subscriber is temporarily unavailable. So, I set up persistence in
activemq.xml:
<persistenceAdapter>
<journaledJDBC journalLogFiles="5" dataDirectory="../data"/>
</persistenceAdapter>
And changed line 44 in publisher.rb to
@conn.send '/topic/event', @body, {'persistent'=>'true'}
However, the messages get delivered only if listener.rb is also running. I
want to be able to run publisher.rb, have the messages stored by activemq,
then run listener.rb and retrieve all the messages that were sent. This
doesn't work. How can I set this up?
thanks,
Eugene
--
View this message in context: http://www.nabble.com/persistence-not-working-tp19281689p19281689.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: persistence not working
Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Sep 3, 2008 at 6:03 PM, Eugene79 <sp...@yahoo.com> wrote:
>
> ooook. Can somebody point me to *any* sample code to do this. Java, ruby,
> anything. ActiveMQ documentation is practically non-existent.
Here are links to the source for the producer and consumer in the
ActiveMQ examples:
http://fisheye6.atlassian.com/browse/activemq/tags/activemq-5.1.0/assembly/src/release/example/src/ProducerTool.java?r=trunk
http://fisheye6.atlassian.com/browse/activemq/tags/activemq-5.1.0/assembly/src/release/example/src/ConsumerTool.java?r=trunk
The Java examples are extremely easy to use and are documented here:
http://activemq.apache.org/examples.html
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Blog: http://bruceblog.org/
Re: persistence not working
Posted by Jim Gomes <e....@gmail.com>.
Check here:
http://remark.wordpress.com/articles/publish-subscribe-with-activemq-and-nms/
Google is also great for searching for samples. http://www.google.com
On Wed, Sep 3, 2008 at 5:03 PM, Eugene79 <sp...@yahoo.com> wrote:
>
> ooook. Can somebody point me to *any* sample code to do this. Java, ruby,
> anything. ActiveMQ documentation is practically non-existent.
>
>
>
>
> Eugene79 wrote:
> >
> > Hi,
> >
> > I am investigating ActiveMQ as a message broker solution for our
> > application. I set it up on my machine and tried sample ruby programs. So
> > far it works fine when there is both a publisher and subscriber running.
> > However, what I want to do is make sure that messages can be delivered
> > even if the subscriber is temporarily unavailable. So, I set up
> > persistence in activemq.xml:
> >
> > <persistenceAdapter>
> > <journaledJDBC journalLogFiles="5" dataDirectory="../data"/>
> > </persistenceAdapter>
> >
> > And changed line 44 in publisher.rb to
> >
> > @conn.send '/topic/event', @body, {'persistent'=>'true'}
> >
> > However, the messages get delivered only if listener.rb is also running.
> I
> > want to be able to run publisher.rb, have the messages stored by
> activemq,
> > then run listener.rb and retrieve all the messages that were sent. This
> > doesn't work. How can I set this up?
> >
> > thanks,
> >
> > Eugene
> >
>
> --
> View this message in context:
> http://www.nabble.com/persistence-not-working-tp19281689p19300657.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
Re: persistence not working
Posted by Eugene79 <sp...@yahoo.com>.
ooook. Can somebody point me to *any* sample code to do this. Java, ruby,
anything. ActiveMQ documentation is practically non-existent.
Eugene79 wrote:
>
> Hi,
>
> I am investigating ActiveMQ as a message broker solution for our
> application. I set it up on my machine and tried sample ruby programs. So
> far it works fine when there is both a publisher and subscriber running.
> However, what I want to do is make sure that messages can be delivered
> even if the subscriber is temporarily unavailable. So, I set up
> persistence in activemq.xml:
>
> <persistenceAdapter>
> <journaledJDBC journalLogFiles="5" dataDirectory="../data"/>
> </persistenceAdapter>
>
> And changed line 44 in publisher.rb to
>
> @conn.send '/topic/event', @body, {'persistent'=>'true'}
>
> However, the messages get delivered only if listener.rb is also running. I
> want to be able to run publisher.rb, have the messages stored by activemq,
> then run listener.rb and retrieve all the messages that were sent. This
> doesn't work. How can I set this up?
>
> thanks,
>
> Eugene
>
--
View this message in context: http://www.nabble.com/persistence-not-working-tp19281689p19300657.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: persistence not working
Posted by Jim Gomes <e....@gmail.com>.
Sorry, I thought you might do a Google search on those keywords. In any
case, here are some links:
http://activemq.apache.org/how-do-durable-queues-and-topics-work.html
Also, look to your documentation for your Session interface. That is where
the CreateDurableConsumer() API should reside. You are using Ruby, so I
can't point you to the exact documentation for it. The counterpart in JMS
for CreateDurableConsumer() is unsubscribe(). This deletes the durable
consumer subscription. In NMS (for C#), the counterpart is named
DeleteDurableConsumer().
Hope that gets you a little further. Anyone else have more experience with
Ruby?
- Jim
On Wed, Sep 3, 2008 at 12:32 PM, Eugene79 <sp...@yahoo.com> wrote:
>
> uhhh... ok. So how do I set that up?
>
>
>
> semog wrote:
> >
> > Hi Eugene,
> > The feature you want to use in your situation is called Durable Consumer.
> > The Persistence feature is used to ensure that the message will be
> > delivered if the broker crashes or is rebooted. The Durable Consumer
> > feature is used when the consumer crashes, reboots, or otherwise goes
> > offline.
> >
> > Best,
> > Jim
> >
> > On Tue, Sep 2, 2008 at 7:02 PM, Eugene79 <sp...@yahoo.com> wrote:
> >
> >>
> >> Hi,
> >>
> >> I am investigating ActiveMQ as a message broker solution for our
> >> application. I set it up on my machine and tried sample ruby programs.
> So
> >> far it works fine when there is both a publisher and subscriber running.
> >> However, what I want to do is make sure that messages can be delivered
> >> even
> >> if the subscriber is temporarily unavailable. So, I set up persistence
> >> in
> >> activemq.xml:
> >>
> >> <persistenceAdapter>
> >> <journaledJDBC journalLogFiles="5" dataDirectory="../data"/>
> >> </persistenceAdapter>
> >>
> >> And changed line 44 in publisher.rb to
> >>
> >> @conn.send '/topic/event', @body, {'persistent'=>'true'}
> >>
> >> However, the messages get delivered only if listener.rb is also running.
> >> I
> >> want to be able to run publisher.rb, have the messages stored by
> >> activemq,
> >> then run listener.rb and retrieve all the messages that were sent. This
> >> doesn't work. How can I set this up?
> >>
> >> thanks,
> >>
> >> Eugene
> >> --
> >> View this message in context:
> >> http://www.nabble.com/persistence-not-working-tp19281689p19281689.html
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/persistence-not-working-tp19281689p19296388.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
Re: persistence not working
Posted by Eugene79 <sp...@yahoo.com>.
uhhh... ok. So how do I set that up?
semog wrote:
>
> Hi Eugene,
> The feature you want to use in your situation is called Durable Consumer.
> The Persistence feature is used to ensure that the message will be
> delivered if the broker crashes or is rebooted. The Durable Consumer
> feature is used when the consumer crashes, reboots, or otherwise goes
> offline.
>
> Best,
> Jim
>
> On Tue, Sep 2, 2008 at 7:02 PM, Eugene79 <sp...@yahoo.com> wrote:
>
>>
>> Hi,
>>
>> I am investigating ActiveMQ as a message broker solution for our
>> application. I set it up on my machine and tried sample ruby programs. So
>> far it works fine when there is both a publisher and subscriber running.
>> However, what I want to do is make sure that messages can be delivered
>> even
>> if the subscriber is temporarily unavailable. So, I set up persistence
>> in
>> activemq.xml:
>>
>> <persistenceAdapter>
>> <journaledJDBC journalLogFiles="5" dataDirectory="../data"/>
>> </persistenceAdapter>
>>
>> And changed line 44 in publisher.rb to
>>
>> @conn.send '/topic/event', @body, {'persistent'=>'true'}
>>
>> However, the messages get delivered only if listener.rb is also running.
>> I
>> want to be able to run publisher.rb, have the messages stored by
>> activemq,
>> then run listener.rb and retrieve all the messages that were sent. This
>> doesn't work. How can I set this up?
>>
>> thanks,
>>
>> Eugene
>> --
>> View this message in context:
>> http://www.nabble.com/persistence-not-working-tp19281689p19281689.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/persistence-not-working-tp19281689p19296388.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: persistence not working
Posted by Jim Gomes <e....@gmail.com>.
Hi Eugene,
The feature you want to use in your situation is called Durable Consumer.
The Persistence feature is used to ensure that the message will be
delivered if the broker crashes or is rebooted. The Durable Consumer
feature is used when the consumer crashes, reboots, or otherwise goes
offline.
Best,
Jim
On Tue, Sep 2, 2008 at 7:02 PM, Eugene79 <sp...@yahoo.com> wrote:
>
> Hi,
>
> I am investigating ActiveMQ as a message broker solution for our
> application. I set it up on my machine and tried sample ruby programs. So
> far it works fine when there is both a publisher and subscriber running.
> However, what I want to do is make sure that messages can be delivered even
> if the subscriber is temporarily unavailable. So, I set up persistence in
> activemq.xml:
>
> <persistenceAdapter>
> <journaledJDBC journalLogFiles="5" dataDirectory="../data"/>
> </persistenceAdapter>
>
> And changed line 44 in publisher.rb to
>
> @conn.send '/topic/event', @body, {'persistent'=>'true'}
>
> However, the messages get delivered only if listener.rb is also running. I
> want to be able to run publisher.rb, have the messages stored by activemq,
> then run listener.rb and retrieve all the messages that were sent. This
> doesn't work. How can I set this up?
>
> thanks,
>
> Eugene
> --
> View this message in context:
> http://www.nabble.com/persistence-not-working-tp19281689p19281689.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
Re: persistence not working
Posted by Eugene79 <sp...@yahoo.com>.
ok, thanks. I got the durable java client to work. But I still need to get it
to work in ruby. There is absolutely no documentation on that. For that
matter, I did not find *any* documentation of the ruby Stomp package. Can
anyone help here?
thanks,
Eugene
Eugene79 wrote:
>
> Hi,
>
> I am investigating ActiveMQ as a message broker solution for our
> application. I set it up on my machine and tried sample ruby programs. So
> far it works fine when there is both a publisher and subscriber running.
> However, what I want to do is make sure that messages can be delivered
> even if the subscriber is temporarily unavailable. So, I set up
> persistence in activemq.xml:
>
> <persistenceAdapter>
> <journaledJDBC journalLogFiles="5" dataDirectory="../data"/>
> </persistenceAdapter>
>
> And changed line 44 in publisher.rb to
>
> @conn.send '/topic/event', @body, {'persistent'=>'true'}
>
> However, the messages get delivered only if listener.rb is also running. I
> want to be able to run publisher.rb, have the messages stored by activemq,
> then run listener.rb and retrieve all the messages that were sent. This
> doesn't work. How can I set this up?
>
> thanks,
>
> Eugene
>
--
View this message in context: http://www.nabble.com/persistence-not-working-tp19281689p19304183.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.