Quantcast

Persistent activemq messages

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Persistent activemq messages

kiroalbatrosa
Hi all,

I have activemq set up in a docker swarm env, and I set up the data directory to our shared NFS volume so that we wouldn`t lose any messages/data when the service changes nodes.So far so good but when we restart the service to test out the settings the messages in the queue are still lost, I have also changed the broker in the activemq.xml as such:

 broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" persistent="true" deleteAllMessagesOnStartup="false" useShutdownHook="false" schedulerSupport="true"


Can someone please share some thoughts on what is missed or needs amending to achieve persistence properly?
Thanks in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Persistent activemq messages

tabish121@gmail.com
On 03/20/2017 08:31 AM, kiroalbatrosa wrote:

> Hi all,
>
> I have activemq set up in a docker swarm env, and I set up the data
> directory to our shared NFS volume so that we wouldn`t lose any
> messages/data when the service changes nodes.So far so good but when we
> restart the service to test out the settings the messages in the queue are
> still lost, I have also changed the broker in the activemq.xml as such:
>
>   broker xmlns="http://activemq.apache.org/schema/core"
> brokerName="localhost" dataDirectory="${activemq.data}" persistent="true"
> deleteAllMessagesOnStartup="false" useShutdownHook="false"
> schedulerSupport="true"
>
>
> Can someone please share some thoughts on what is missed or needs amending
> to achieve persistence properly?
> Thanks in advance.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Persistent-activemq-messages-tp4723885.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Are you sending messages with delivery mode of persistent?


--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Persistent activemq messages

kiroalbatrosa
Thanks for tip, delivary mode is not set. Where would I set it up in the activemq.xml, and should it look like this?

producer.setDeliveryMode(DeliveryMode.PERSISTENT);

Thanks again.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Persistent activemq messages

tabish121@gmail.com
On 03/20/2017 11:28 AM, kiroalbatrosa wrote:

> Thanks for tip, delivary mode is not set. Where would I set it up in the
> activemq.xml, and should it look like this?
>
> producer.setDeliveryMode(DeliveryMode.PERSISTENT);
>
> Thanks again.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Persistent-activemq-messages-tp4723885p4723894.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Yes, you need to tell the producer to mark the sent messages as persistent.

--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Persistent activemq messages

kiroalbatrosa
Thanks tabish,

I just want to be sure on the matter since I have not set up activemq before, is it ok to pu that anywhere in the broker or does it need a specific place in the xml?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Persistent activemq messages

tabish121@gmail.com
On 03/20/2017 11:49 AM, kiroalbatrosa wrote:

> Thanks tabish,
>
> I just want to be sure on the matter since I have not set up activemq
> before, is it ok to pu that anywhere in the broker or does it need a
> specific place in the xml?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Persistent-activemq-messages-tp4723885p4723896.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Sending messages persistently is not something you do on the broker
side, your client controls when messages are sent as persistent or not
using the DeliveryMode that is set on a MessageProducer, or one of its
send methods that accepts a DeliveryMode value.

--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Persistent activemq messages

kiroalbatrosa
This post has NOT been accepted by the mailing list yet.
That's the ticket, thank you very much :)
Loading...