In our application, we receive messages from JMS Topic.
- First I want to know if the JMS follows FIFO policy. If not, how can an application decide which is the latest message?
We consume messages ( durable subscriber and JMS session is transacted, lot of overhead ) because messages are retained at the JMS server until the transaction commits/ends. The reason we specified transaction is
We are using a caching ( hibernate ) technology and a transaction to use it. So, we are using two transactions, one is JMS tx and one is caching-technology tx. When we consume the message and we want all or nothing to happen until the message is committed and acknowledgement is sent to JMS. caching tx will commit first and then immediately JMS tx will commit next and message is acknowledged, otherwise, both the tx's will be rolledback and the message will be replayed. We are currently replaying the messages 3 times, and then if the exception still occurs, then we are sending the message to non-processable queue.
This works fine until lot of messages come at the same time to the JMS and needs to be processed by our system at the same time.
I would like to know what did you do when you encountered such scenario. Because, maintaining a durable subscription and a transacted session is a significant overhead over the JMS server and would drain the performance of the server.