.NETCompute ノードによるヘッダーへのアクセス

メッセージ・アセンブリーのヘッダーにアクセスするには、.NETCompute ノードを使用します。

メッセージング・シナリオでよく見られるヘッダーに、MQMD と MQRFH2 の 2 つがあります。 入力ノードが認識するメッセージ・ヘッダーを含む入力メッセージを、その入力ノードが受信する場合、ノードは各ヘッダーの適切なパーサーを起動します。ほとんどの WebSphere® MQ ヘッダーで、パーサーが提供されています。 このトピックでは、MQMD および MQRFH2 ヘッダーの情報にアクセスするための指針が提供されています。この指針は、メッセージ内にある別のヘッダーにアクセスする際に従うことができます。

こうした内容、および WebSphere Message Broker でパーサーが提供されているその他の WebSphere MQ ヘッダーについて詳しくは、メッセージ・パーサーのエレメント定義を参照してください。

以下の C# コードは、.NETCompute ノードを使って MQMD ヘッダーおよび MQRFH2 ヘッダーをメッセージに追加する方法を示しています。
        public override void Evaluate(NBMessageAssembly inputAssembly)
        {
            NBOutputTerminal outTerminal = OutputTerminal("out");

            NBMessage inputMessage = inputAssembly.Message;

            // Create a new empty message, ensuring it is disposed after use
            using (NBMessage outputMessage = new NBMessage())
            {
                NBMessageAssembly outAssembly = new NBMessageAssembly(inputAssembly, outputMessage);
                NBElement inputRoot = inputMessage.RootElement;
                NBElement outputRoot = outputMessage.RootElement;
                
                #region UserCode
                // Add user code in this region to create a new output message
                NBElement MQMD = outputRoot.CreateLastChildUsingNewParser(NBParsers.NBHeaderParsers.MQMD.ParserName);                
                NBElement MQRFH2 = outputRoot.CreateLastChildUsingNewParser(NBParsers.NBHeaderParsers.MQRFH2.ParserName);
                #endregion UserCode

                // Change the following if not propagating message to the 'Out' terminal
                outTerminal.Propagate(outAssembly);
            }
        }
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック

Copyright IBM Corporation 1999, 2012Copyright IBM Corporation 1999, 2012.

        
最終更新

        最終更新 : 2012-07-13 15:45:09


タスク・トピックタスク・トピック | バージョン 8.0.0.1 | bc34216_