Amqmdnet - Is it performant to open/close the queue for each message?

后端 未结 1 1895
悲&欢浪女
悲&欢浪女 2021-01-15 01:02

We have some code to send messages to a queue. It\'s using the amqmdnet dll version 8.0.0.6.

The queue manager (Queuemanager) is instantiated once at the start of t

相关标签:
1条回答
  • 2021-01-15 01:25

    An older IBM MQ developerWorks article has some very good recommendations in general is "The top 15 WebSphere MQ best practices". Specific to your question it states the following:

    Build with performance in mind

    Although MQ was built for high transaction volumes, poor architecture and application design can compromise its ability to process messages as fast and effectively as possible. To mitigate potential performance issues, here are several recommendations:

    • Keep connections and queues open if you are going to reuse them instead of repeatedly opening and closing, connecting and disconnecting.

    From a IBM MQ Client standpoint each queue open and close is a round trip on the network, depending on the latency between the MQ Client and the MQ Queue manager this can cause delay on top of the processing MQ needs to do when you open and close a queue, for example checking if you have permission to open the queue and opening the underlying q file on the disk.


    If you are putting persistent messages outside of a unit of work, this can cause locking contention on the queue manager with the application that is reading the messages (the reading application could be a channel agent if the queue you put to is a QREMOTE).

    Putting multiple messages under the same unit of work will also increase performance, how much would depend on the underlying storage.

    0 讨论(0)
提交回复
热议问题