What is the best way to pull the messages from MQ queue.
Posted on 2014-04-03
I have written a C# Win service to pull the messages from Websphere MQ queue. I have a question here on the approach to be followed.
1. Open the connection only once to the queue and pull all the messages and keep checking for the messages forever and never close the connection.
2. Establish the connection to queue and then pull the message and then close it immediately. And do the same for every message.
What is the best way? And why?
I have opeted the 2nd one, but one of my friend suggest the 1st one. Please suggest me which is the best way.