I have Queue and Topic with 2 posts in Activemq . If I restart Activemq . I am losing posts as well as Topic .
Queue
Topic
Activemq
Even if I restart Activemq , I do not want to lose messages from any Topic and Queue . Is it possible.
I am using Activemq 5.8.0 .
Activemq 5.8.0
The producer creates a message and sends it to the topic that the consumer is ever working at this point in time, will receive the message. If you want a consumer who is not working right now, but who can work in the Future to receive this message, you will have to tell the Broker to save the message and keep the information that this percussive consumer has not received the message.
If you have working code without a trusted subscriber, you will need to make the following changes.
In the consumer1. Install the clientele. Because the Subject must know which consumer has not yet received the message. Or received a message.
Connection.setClientID(String)
2. A reliable subscriber must be created for your topic.
Connection.createDurableSubscriber()
3. Add your listener to this subscriber.
subscriber.setMessageListener(yourlistener)
4. When you receive the message, you will need to confirm it.
This link shows how this is done: But its in C # I think.
http://myadventuresincoding.wordpress.com/2011/08/16/jms-how-to-setup-a-durablesubscriber-with-a-messagelistener-using-activemq/
Read these links for more information:
http://activemq.apache.org/how-do-durable-queues-and-topics-work.html http://activemq.apache.org/why-do-i-not-receive-messages-on-my -durable-topic-subscription.html http://activemq.apache.org/manage-durable-subscribers.html
Source: https://habr.com/ru/post/904165/More articles:How to rollback messages in Activemq - javaLog4j: DailyRollingFileAppender with the MaxFileSize option - log4jPassing an anonymous class - javaIncluding a branch file from a branch - symfonyJavascript encoding - javascriptUsing XMPP to send real-time information to an iOS app - iosHow to stop a floating div at a specified point using jQuery - javascriptConfiguring multiple log files in log4j when using categories - log4jConditional display elements using Razor - asp.net-mvc-3WiX - saving registry settings during main update - installerAll Articles