これが私の状況です。
管理されたキューを使用している永続的なサブスクリプションで保留中のメッセージの参照機能が必要です (そのため、サブスクリプションのキューに直接アクセスできません)。
これがキューの場合、単純に次のようなものを使用します
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 のトピックでは、利用可能な BROWSE フラグはありません
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
);
すっごく、これが可能かどうか疑問に思っていますか?アプリが再アタッチする前に、永続的なサブスクリプションから何をどれだけのメッセージを消費しようとしているのかをアプリが通知する方法が必要だと思います!?
このすべての目的は、サービス アプリケーションが、トラブルシューティングの場合に、その永続的なサブスクリプション内のすべての「保留中」のメッセージを対話型ユーザーに表示できるようにすることであることに注意してください。
助けていただける方、よろしくお願いします!
乾杯、クリス