0
votes

We have an IBM MQ JMS queue and want to distribute the data into multiple consumers for load balancing. So if we write two JMS Clients to consume from same JMS queue what will happen? Will Messages be equally distributed across both consumers since one consumer will delete the data after it is read? Is there a possibility for data duplication, like if the same message is read by both consumers in a race condition?

1

1 Answers

2
votes

My comments below are based on destructive get and not a browse get.

So if we write two JMS Clients to consume from same JMS queue what will happen?

They will both consume messages.

Will Messages be equally distributed across both consumers since one consumer will delete the data after it is read?

No. The "hot" consumer will be feed the next available message, assuming it is "getting" a message again before the next message arrives.

Is there a possibility for data duplication, like if the same message is read by both consumers in a race condition?

Not if you are performing a destructive get (the default).