开发者

WebSphereMQ PCFMessageAgent / PCFAgent - Is it Thread Safe?

开发者 https://www.devze.com 2023-04-01 19:39 出处:网络
I am implementing a monitoring and administrative MQ API using the WebSphereMQ java PCF (Program Control Format) library. What I would like to know is if the PCFAgent and/or the PCFMessageAgent classe

I am implementing a monitoring and administrative MQ API using the WebSphereMQ java PCF (Program Control Format) library. What I would like to know is if the PCFAgent and/or the PCFMessageAgent classes are thread safe. The documentation does not make it clear [to me].

开发者_运维技巧

If not, then I have 2 choices:

  1. Create a pool of agents
  2. Create (and disconnect) agents on demand.

Any insight into this issue is appreciated.

Cheers.


The important information you seek is probably on this page:

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaw.doc%2Fja11160_.htm

The main issue you will see is that the MQQueueManager object (that you either pass in, or is created for you) cannot really do 2 things at once on a single connection.

So if you have one Agent sitting on a get-with-wait waiting for a response to a big query (saying getting full details for thousands of queues) nothing else can be done using that connection until the reply comes back.

Connect/Disconnect are the biggest overhead when talking to MQ, so if you need multiple threaded access I would go with option 1 otherwise you'll pay a big penalty in performance having to wait for connect each time.

0

精彩评论

暂无评论...
验证码 换一张
取 消