2010-06-22 99 views
0

这是我的情况。浏览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 
        ); 

然而,在durablesub'd话题,没有可用的浏览标志

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,我只是想知道这是否可能?我猜测应用程序必须通过某种方式来告诉它在重新附加之前要从持久订阅中消耗多少消息?

请注意,所有这些的目的是允许服务应用程序在故障排除的情况下向其交互式用户显示所有“待处理”消息的持久订阅。

预先感谢任何能够帮助的人!

干杯, 克里斯

回答

2

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

+0

Hey T.Rob。我从来没有注意到你的回复(这是问题后的一段时间),但最终确实成为我们采取的方法。所以这在我看来是最好的答案! – DigitalPigeon 2017-08-25 18:44:33

+0

感谢您的更新,并很高兴您能够正常工作! – 2017-08-26 06:41:23