WebSphere® ESB MQ データ・バインディング・サンプルでは、MQ データ・バインディングの作成方法を説明します。
Wsadmin –lang jython –f MQDataBindingJNDIResources.py [–mqhost hostname] [–mqport portnumber] –qmname qmname –request_input_q req_in_q –request_output_q req_out_q –response_input_q resp_in_q –response_output_q resp_out_q [-clean]
java MQTest queueManager request_input_Queue request_output_Queue response_input_Queue response_ouptut_QueueMQ サーバー・マシンは、 メッセージを区切り文字「,」で区切って要求入力キューに入れます。MQ データ・バインディング・サンプルがこのメッセージを取り出してヘッダーを変更し、固定長のメッセージを要求出力キューに出力します。メッセージは各要素が 15 文字の固定長で、 埋め込み文字として「~」を使用します。次に、MQTest クラスがそのメッセージを取り出し、以下の例に示すようにヘッダーとメッセージ内容を表示します。
Sending message: 23,John,Doe,address,10,577 Airport Blvd,Burlingame,CA,94010, to the req_in queue. Message received from the req_out queue: strucID = WESB strucLength = 20 msgType = FXLN msgOption1 = 15 msgOption2 = ~ Message length is 135 Message type is 1 Received message: 23~~~~~~~~~~~~~John~~~~~~~~~~~Doe~~~~~~~~~~~~address ~~~~~~~~10~~~~~~~~~~~~~577 Airport BlvBurlingame~~~~~CA~~~~~~~~~~~~~94010~~~~~~~~~~次に、メッセージは応答入力キューに転送されます。 応答メディエーション・フローがそのメッセージを取り出して、区切り文字で区切られたメッセージに戻し、応答出力キューに出力します。 MQTest は、次の例で示すように応答出力キューから最終メッセージを取り出し、ヘッダーとメッセージを表示します。
Sending message: 23~~~~~~~~~~~~~John~~~~~~~~~~~Doe~~~~~~~~~~~~address ~~~~~~~~10~~~~~~~~~~~~~577 Airport BlvBurlingame~~~~~CA~~~~~~~~~~~~~94010~~~~~~~~~~ to the resp_in queue. Message received from the resp_out queue: strucID = WESB strucLength = 20 msgType = DELI msgOption1 = , msgOption2 = Message length is 59 Message type is 2 Received message: 23,John,Doe,address,10,577 Airport Blv,Burlingame,CA,94010,