浏览 WebSphere MQ 持久订阅

发布于 2024-09-06 15:01:41 字数 1865 浏览 9 评论 0原文

这是我的情况。

我想要一个浏览功能,用于使用托管队列的持久订阅上挂起的消息(因此我无法直接访问订阅的队列)。

如果这是一个队列,我会简单地使用类似的东西

remoteDestination = session.QueueManager.AccessQueue(
                    remoteQueueName,
                    MQC.MQOO_BROWSE                 // request browse mode
                    + MQC.MQOO_FAIL_IF_QUIESCING    // but not if MQM stopping
                    + MQC.MQOO_INQUIRE              // request inquire permissions to read stats
                    );

但是,在一个持久的主题上,没有可用的浏览标志

remoteDestination = session.QueueManager.AccessTopic(
                    remoteTopicName,
                    remoteTopicObject,                    
                    MQC.MQOO_BROWSE                 //can not use an MQOO option here!!!
                    + MQC.MQSO_CREATE                 // create the topic if not already created
                    + MQC.MQSO_ANY_USERID           // allow any user to reattach to this subscription in the future
                                                    // otherwise, only the user who created the subscription can reattach
                    + MQC.MQSO_ALTER                // create (or reattach) to subscription requesting rights to make changes
                    + MQC.MQSO_FAIL_IF_QUIESCING    // if the server is shutting down, fail 
                    + MQC.MQSO_DURABLE              // the subscription is durable
                    + MQC.MQSO_MANAGED,             // the queue manager will create consup
                    "",                             // alternate user ID
                    subscriptionName                // name of the subscription
                );

所以,我只是想知道这是否可能?我猜想应用程序必须有某种方法来告诉它在重新附加之前要从持久订阅中消耗什么消息以及多少消息!?

请注意,所有这一切的目的是允许服务应用程序向其交互式用户显示其持久订阅中的所有“待处理”消息,以便在故障排除时进行。

预先感谢任何可以提供帮助的人!

干杯, 克里斯

here is my situation.

I want to have a browse function for messages pending on a durable subscription which is using managed queues (so I can not access the subscription's queue directly).

If this was a queue, I would simply use something like

remoteDestination = session.QueueManager.AccessQueue(
                    remoteQueueName,
                    MQC.MQOO_BROWSE                 // request browse mode
                    + MQC.MQOO_FAIL_IF_QUIESCING    // but not if MQM stopping
                    + MQC.MQOO_INQUIRE              // request inquire permissions to read stats
                    );

However, on a durablesub'd topic, there is no available BROWSE flag

remoteDestination = session.QueueManager.AccessTopic(
                    remoteTopicName,
                    remoteTopicObject,                    
                    MQC.MQOO_BROWSE                 //can not use an MQOO option here!!!
                    + MQC.MQSO_CREATE                 // create the topic if not already created
                    + MQC.MQSO_ANY_USERID           // allow any user to reattach to this subscription in the future
                                                    // otherwise, only the user who created the subscription can reattach
                    + MQC.MQSO_ALTER                // create (or reattach) to subscription requesting rights to make changes
                    + MQC.MQSO_FAIL_IF_QUIESCING    // if the server is shutting down, fail 
                    + MQC.MQSO_DURABLE              // the subscription is durable
                    + MQC.MQSO_MANAGED,             // the queue manager will create consup
                    "",                             // alternate user ID
                    subscriptionName                // name of the subscription
                );

Sooooo, I am simply wondering if this is possible? I'm guessing there must be SOME way for an app to tell what and how many messages its about to consume from a durable subscription before it re-attaches!?

Note that the purpose of all this is allow a service application to display to its interactive user all of the "pending" messages in its durable subscription in case of trouble shooting.

Thank you in advance to anyone who can help out!

Cheers,
Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

上课铃就是安魂曲 2024-09-13 15:01:41

您可以查询订阅以获取关联的托管队列的名称,然后使用正常方法浏览或查询该队列。您是对的,没有用于持久订阅的浏览 API。

You can inquire on the subscription to obtain the name of the associated managed queue, then browse or inquire on that queue using normal methods. You are correct that there is no browse API for a durable subscription.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文