Requirements:
In one project I need to fetch messages from topic.
When my app will be restarted or started after the publisher already sent some messages the app should re-fetch but only the last message put on topic.
What I did:
I have created a spring jms listener which is a topic subscriber using annotation. It is a durable retroactive listener with a random client id so that it will fetch messages sent before subscription start and after every restart producer will treat it as a new subscriber and will send messages already consumed before the restart.
Problem:
After restart all previously sent messages are being fetched and the requirement is that only the last message sent will be fetched.
ActiveMQ is my message broker and I cannot administer it.
I will greatly appreciate any hint how to do that better? :)
Cheers