I want to do this:
-
ActiveMQ sends a message to the client.
-
The client sends acknowledgement to ActiveMQ after processing the message.
-
If the client is down, or did not acknowledge the message, this message will remain in the queue. All other messages will not be delivered.
-
The server sends the messages one at a time and the client processes the messages one at a time. Unless the first message has been acknowledged, the next message won’t be delivered.
Is there a way to do this?
Regarding drawbacks in failure, this is how activeMQ works.
If the “failure/bad acknowledge” happens on the business logic layer then you should use transactions
Warning Not a valid code (pradigm)
Regarding the message throttling and persistence the following configuration of destination policy will assist you.
IMHO I would also use MySQL for this kind of persistence
Also I advise you to use Camel to configure your throttler as you wish.