2017-07-15 21 views
1

トピックを作成してIBM MQトピックにメッセージを発行しようとしています。 2085 MQの例外が発生しており、これを解決する方法がわかりました。
使用しているIBM.XMS.dllのバージョンは8.0.0.6です。CreateTopicのIBM MQ XMSエラー2085

コンソールアプリコード:

static void Main(string[] args) 
    { 
     try 
     { 
      XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ); 

      IConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory(); 
      Console.WriteLine("Connection Factory created."); 

      connectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "MQ_TX_MGR"); 
      connectionFactory.SetStringProperty(XMSC.WMQ_CONNECTION_NAME_LIST, "10.10.10.10(1414)"); 
      connectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, "CL.SVRCONN"); 

      connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT); 
      connectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT); 
      connectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, 3); 

      mqConnection = connectionFactory.CreateConnection(); 
      Console.WriteLine("Connection created."); 

      session = mqConnection.CreateSession(false, AcknowledgeMode.AutoAcknowledge); 
      Console.WriteLine("Session created."); 


      IDestination destination = session.CreateTopic("topic://TOPIC/NAME"); // destinationName 
      Console.WriteLine("Destination created."); 

      // create producer 
      IMessageProducer producer = session.CreateProducer(destination); //My Code is erroring out at this line. 

     } 
     catch (Exception ex) 
     { 
      Console.WriteLine(ex.Message); 
     } 
     finally 
     { 
      Console.WriteLine("Program waiting for message:"); 
      Console.ReadLine(); 
     } 

    } 

例外の詳細:

Error Message:
CWSMQ0006E: An exception was received during the call to the method WmqV6Session.SetupPubSub: CompCode: 2, Reason: 2085. During execution of the specified method an exception was thrown by another component. See the linked exception for more information.

Linked Exception Reason: 2085

Linked Exception Stack Trace:
at IBM.WMQ.MQDestination.Open(MQObjectDescriptor& od) at IBM.WMQ.MQQueue..ctor(MQQueueManager qMgr, String queueName, Int32 openOptions, String queueManagerName, String dynamicQueueName, String alternateUserId) at IBM.WMQ.MQQueueManager.AccessQueue(String queueName, Int32 openOptions, String queueManagerName, String dynamicQueueName, String alternateUserId) at IBM.WMQ.MQQueueManager.AccessQueue(String queueName, Int32 openOptions) at IBM.XMS.Client.WMQ.MqV6Impl.WmqV6Session.SetUpPubSub(Boolean startCleanup)

+0

「IBM.XMS.dll」のどのMQのどのバージョンで、接続しているキュー・マネージャー上でどのバージョンのMQが実行されていますか? – JoshMc

+0

@ JoshMcクライアントとサーバーの両方に8.0.06がある – PushCode

+0

SVRCONNチャネルのSHARECNV値を確認できますか? – JoshMc

答えて

2

SVRCONNチャネルのチャネル番号がSHARECNVで、1以上であることを確認してください。

This value specifies no sharing of conversations over a TCP/IP socket. The channel instance behaves exactly as if it was a Version 6.0 server or client connection channel, and you do not get the extra features such as bi-directional heartbeats that are available when you set SHARECNV to 1 or greater. Only use a value of 0 if you have existing client applications that do not run correctly when you set SHARECNV to 1 or greater.

IBM MQ V8サポート技術情報センターのページ "XMSC_WMQ_PROVIDER_VERSION" 次を文書化:

引き起こす

By default this property is set to "unspecified".

...

IBM WebSphere MQ Version 7.0 specific features are disabled if XMSC_WMQ_PROVIDER_VERSION is set to UNSPECIFIED and SHARECNV is set to 0.

IBM MQ V8サポート技術情報センターのページ "MQI client: Default behavior of client-connection and server-connection channels" は、以下程度SHARECNV(0)ドキュメントXMSを使用してSTREAMキューを使用して、キューに登録されたパブリッシュ/サブスクライブを持つメッセージをパブリッシュしようとしました。 1以上に設定してv7スタイルの接続を取得し、通常のv7のパブリッシュ/サブスクライブを使用します。

SHARECNV(0)の一部のバージョンでは、特定の問題の回避策がありましたが、この回避策を使用しているv8の問題はわかりません。

+0

私のチャンネルでは、「共有会話」プロパティが「0」に設定されています – PushCode

+1

それが問題です。 'SHARECNV(0)'は 'v6'型の接続を強制します。これにより、XMSはSTREAMキューを使用してメッセージを発行しようとします。 1以上に設定してください。いくつかの過去のバージョンでは、0に設定すると特定の問題を回避することができましたが、この回避策があるv8の問題はわかりません。 – JoshMc

+0

設定を変更しました。ありがとうJoshMc – PushCode

0

"のトピック://" で始まる必要がありますトピックの宛先を指定するための構文。例えば、session.CreateTopic("topic://Score/Football")。詳細については、文書 hereを参照してください。

+0

私もそれを試みました。同じエラー – PushCode

+0

2085は、不明なオブジェクトを意味します。驚いているのは2085年の話題です。あなたが変更を行った場所で更新されたコードを表示できますか? – Shashi

+0

メインの質問で更新されたコード: 'IDestination destination = session.CreateTopic(" topic:// TOPIC/NAME "); // destinationName – PushCode