We are using the .NET API to IBM's WebSphere MQ.
Creating the MQQueueManager object is clearly an expensive operation, and so we cache and reuse a pool of these objects.
Currently, for each request, we access the required queues:
//obtain queueManager from pool
IBM.WMQ.MQQueue requestQ= queueManager.AccessQueue(requestQName, mqOptions);
IBM.WMQ.MQQueue responseQ= queueManager.AccessQueue(responseQName, mqOptions);
and close them once done:
requestQ.Close();
responseQ.Close();
Is this best practice, or should we be also pooling and reusing the MQQueue objects (in addition to the queue manager)? AccessQueue() appears to be a cheap operation on the client.