The WebSphere® ESB MQ data binding sample demonstrates how to write a MQ data binding.
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_QueueThe MQ server machine will put a delimited message on to the request input queue, with a ‘,’ as the delimiter. The MQ data binding sample will pick up this message, change the header, and output a fixed length message on to the request output queue. The message has a fixed length of 15 characters per element, and a ‘~’ as the padding character. The MQTest class will then pick up the message and display the header and message content, as the example is shown below:
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~~~~~~~~~~The message is then forwarded to the response input queue. The response mediation flow will pick up the message, change it back to a delimited message, and output it onto the response output queue. MQTest will pick up the final message from the response output queue and display the header and message, as the example is shown below.
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,