tags:

views:

7

answers:

0

Hi all, 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