I've a simple Spring-boot application with JTA base on Atomikos Transaction Manager. It consumes messages from a queue and logs them. The problem is that after the 7th incoming message the rest of the message in the queue are dequeued but are not processed. I realized that this performance is looping, I mean:
- Inserted 10 messages in the queue.
- Processed and dequeued 1st message.
- Processed and dequeued 2nd message.
- Processed and dequeued 3rd message.
- Processed and dequeued 4th message.
- Processed and dequeued 5th message.
- Processed and dequeued 6th message.
- Processed 7th message and dequeued 7th,8th,9th and 10th messages.
- Inserted other 10 messages in the queue.
- Processed and dequeued 11th message.
- Processed and dequeued 12th message.
- Processed and dequeued 13th message.
- Processed and dequeued 14th message.
- Processed and dequeued 15th message.
- Processed and dequeued 16th message.
- Processed 17th message and dequeued 17th,18th,19th and 20th messages.
Moreover, I realized that without the transaction manager enabled it processes and consumes all the message in the queue.
Is there any bug or configuration that I forgot about that point?
You can find the full code on: https://github.com/PedroRamirezTOR/spring-jta-amq.git