How does JMS read multiple files on a queue

380 Views Asked by At

The application that I am working on listens to a queue. This queue receives multiple files(Buy/Sell order) from upstream. I am new to this application and trying to underatnsd how multiple files are process. We are using camel to listen to the queue. I understand that camel listens to the queue and when a file comes in it reads it and routes it to a java file to process it. My question is meanwhile a second or 100 messages arrives on the queue. How are these multiple files handles..would camel spawn a new thread to keep listening to messages while other thread routes it??

1

There are 1 best solutions below

0
On

Would camel spawn a new thread to keep listening to messages while other thread routes it?

This depends on your camel jms consumer setup for concurrentConsumers and maxConcurrentConsumers.

concurrentConsumers specify the initial number of concurrent consumer (listener thread/caller thread) for the route. Similarly, maxConcurrentConsumers specify the maximum number of concurrent consumer for the route.

Camel will spawn a new thread for the jms route if maxConcurrentConsumers > concurrentConsumers and hit the limit for consumers.