I have a program that creates a pool of MQ connections and then creates as many threads as the number of connections.
If each thread then tries to read a message under a syncpoint and does some processing on the messsage, is it guaranteed that 2 different threads won't try to read the same message?.
Yes, multiple threads, processes or even separate instances of the application on the same or different platforms can "compete" for messages on the same queue.
This is a good way to provide scalability, load balancing and fault tolerance for MQ applications. The queue manager will ensure that a given message is not processed by more than one application at the same time.
Your MQGETs should specify a WAIT interval (eg 30 seconds) before repeating the get request - DON'T POLL THE QUEUE. Your application can check for any request to shut itself down in between re-issuing the get requests. Remember to code FAIL_IF_QUIESCING on the MQGET.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum