WebSphereMQ PCFMessageAgent / PCFAgent - 线程安全吗?
我正在使用 WebSphereMQ java PCF(程序控制格式)库实现监视和管理 MQ API。我想知道的是 PCFAgent 和/或 PCFMessageAgent 类是线程安全的。 [对我来说]文档并没有说清楚。
如果没有,那么我有 2 个选择:
- 创建代理池
- 根据需要创建(和断开)代理。
任何对此问题的见解都值得赞赏。
干杯。
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:
- Create a pool of agents
- Create (and disconnect) agents on demand.
Any insight into this issue is appreciated.
Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您寻找的重要信息可能在此页面上:
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaw.doc%2Fja11160_.htm
主要您将看到的问题是 MQQueueManager 对象(您传入的或为您创建的)实际上无法在单个连接上同时执行两件事。
因此,如果您有一个代理坐在 get-with-wait 上等待对大型查询的响应(例如获取数千个队列的完整详细信息),则在回复返回之前无法使用该连接执行任何其他操作。
连接/断开连接是与 MQ 通信时最大的开销,因此如果您需要多线程访问,我会选择选项 1,否则每次都必须等待连接,您将付出巨大的性能损失。
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.