Reusing the IBM.WMQ.MQQueue Object

We use the .NET API for IBM WebSphere MQ.

Creating an MQQueueManager object is clearly an expensive operation, so we cache and reuse the pool of these objects.

Currently, for each request we get access to 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 after execution:

requestQ.Close();
responseQ.Close();

Is this best practice, or should we also combine and reuse MQQueue objects (in addition to the queue manager)? AccessQueue () seems like a cheap operation on the client.

+3
source share
1 answer

. , , . , , . .

, . COMMIT, . , , . , .

// . , ...

  • reply-to destination , ,

, . , , .

0

Source: https://habr.com/ru/post/1779301/


All Articles