<jms:listener-container container-type="default"
connection-factory="testConnectionFactory"
acknowledge="auto"
concurrency="10">
<jms:listener destination="test_queue" ref="testRequestHandler" method="getMessage" />
</jms:listener-container>
So, i have jms connection factory defined with concurrency set to 10 and my consumer can consume 10 messages concurrently at a time. Now, the problem is producer is queuing messages faster than consumer can consume, as a result half of my messages are getting expired in the queue.
The problem I'm facing is:
I think the only way you're going to reach an optimal value is by:
Nobody on the Internet is going to be able to just give you an optimal value. There are too many variables at work.
Lastly, one option you didn't list was imposing flow-control on your producers to limit the amount of messages they can send so that the consumers keep up and you don't get a lot of expired messages. Most modern message brokers provide flow-control to push back on producers so they don't overwhelm them.