浏览 WebSphere MQ 持久订阅
这是我的情况。
我想要一个浏览功能,用于使用托管队列的持久订阅上挂起的消息(因此我无法直接访问订阅的队列)。
如果这是一个队列,我会简单地使用类似的东西
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查询订阅以获取关联的托管队列的名称,然后使用正常方法浏览或查询该队列。您是对的,没有用于持久订阅的浏览 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.