Jms 浏览WebSphere MQ持久订阅
这是我的情况 我想为使用托管队列的持久订阅上挂起的消息提供一个浏览功能(因此我无法直接访问订阅的队列) 如果这是一个队列,我会简单地使用Jms 浏览WebSphere MQ持久订阅,jms,ibm-mq,Jms,Ibm Mq,这是我的情况 我想为使用托管队列的持久订阅上挂起的消息提供一个浏览功能(因此我无法直接访问订阅的队列) 如果这是一个队列,我会简单地使用 remoteDestination = session.QueueManager.AccessQueue( remoteQueueName, MQC.MQOO_BROWSE // request browse mode
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
);
但是,在durablesub的主题上,没有可用的浏览标志
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,我只是想知道这是否可能?我猜应用程序一定有办法在重新连接之前,告诉用户它将从一个持久订阅中消耗多少信息
请注意,所有这些的目的是允许服务应用程序向其交互用户显示其持久订阅中的所有“待定”消息,以防出现故障
提前感谢所有能够提供帮助的人
干杯,
Chris您可以查询订阅以获取关联的托管队列的名称,然后使用常规方法浏览或查询该队列。您认为持久订阅没有浏览API是正确的。Hey T.Rob。我从来没有注意到你的回答(这是在问题之后的一段时间),但它确实也是我们采取的方法。所以在我看来,这实际上是最好的答案!