Reputation: 109
I am new to mule and trying to understand how max concurrency works? I understand that is to the determine how many simultaneous request can be received. But I have a question, in case I have huge incoming requests to the application, if I set the max concurrency will the subsequent requests be in queue or it error out or data will be lost?
For example, say I am getting around 10,000 requests to my application and I set the max concurrency to 1000. So the other 9000 will be in the queue or there is a chance of data loss?
Also what would be the ideal max concurrency that can be set for flow?
Thanks in advance.
Upvotes: 0
Views: 4212
Reputation: 25664
I'm not sure to which queue are you referring to. In Mule 4 requests are not queued. If a flow sets maxConcurrency, any concurrent request exceeding that number will fail with an error. If that causes data loss will probably depend on what your application is doing. maxConcurrency just limits the concurrency, without you needing to think on terms of the implementation or numbers of threads.
If your application is reading from a queue (ie a JMS or VM queue), it would be expected it can not read more than maxConcurrency simultaneous messages, so the other messages should remain in the queue and not trigger an error.
Note that maxConcurrency doesn't guarantees that an application can actually process as many concurrent requests. If you set it to 1000, you have to ensure that your application will have enough resources to process that many concurrent requests. The only way to know how to size it is to perform load testing in conditions similar to the real expected usage and verify at what number you start getting errors due to not enough resources.
A special case is when you want just a specific number. For example a flow reading from a queue with maxConcurrency = 1 to process only one message at a time.
Upvotes: 2