Thank you @Joshua_Buckton for your detailed response. @gazzaknight, we will work on improving the documentation with some example.
Documentation says that “prefetched messages are processed serially.”. I think this sentence is leading to the confusion that all messages will be executed serially. That is not the case here. Only the prefetched messages of a consumer would be processed serially as prefetch cache is per consumer. In case of concurrent processing, as Joshua mentioned, there would be multiple consumers running in parallel and each of these consumer will be prefetching their messages in parallel and then processing their messages serially.
Now this could, in some cases, impact the processing time especially when multiple consumers are idle waiting for messages to arrive.
Consider this scenario - you have 5 large messages in queue, you have subscriber with long running service and you have set concurrency to 5 and prefetch size to 5.
In the above case first consumer will fetch all 5 messages and start executing them serially. Remaining ones would be idle. On top of that, since message size is large, consumer has to wait until all the messages are fetched before processing them.
Now, if instead prefetch size was set to 1 in this case then consumer 1 would have pulled 1 message and start executing it. Since consumer service is long running, meanwhile consumer 2 would fetch the second message and start executing it and so on. So, in this scenario, 5 messages would be processed by 5 different consumers in short span of time and the services will be executed in parallel as opposed to one consumers fetching all the 5 and executing them one after the other.
The note was meant to warn for such scenarios. We must remember that prefetch is good as it reduces load on messaging provider and concurrency is good (if order does not matter) as it improves processing time. However one must come to right setting based on their message size and service execution time.
Thank you for sharing your concern with us. We will enhance the document.
#Universal-Messaging-Broker#webMethods-cloud#webMethods#webMethods-io-Integration