Send fixed-size data to
a TCP/IP client connection and receive fixed-size data back on the
same connection (synchronously), by the use of a message flow with MQInput, TCPIPClientOutput, TCPIPClientReceive, and MQOutput nodes.
About this task
Scenario: An application sends synchronous data
between TCP/IP client connections.
Instructions: The
following steps describe how to create a message flow that sends data
out from a client connection and waits on the same connection for
a reply to be returned. The request is synchronous in the same flow,
because the TCPIPClientReceive node
waits for data to be returned.
Procedure
- Create a message flow called TCPIP_Task6 with
an MQInput node, a TCPIPClientOutput node, a TCPIPClientReceive node, and
an MQOutput node.
- Connect the Out terminal of the MQInput node to the In terminal
of the TCPIPClientOutput node.
- Connect the Out terminal of the TCPIPClientOutput node to the
In terminal of the TCPIPClientReceive node.
- Connect the Out terminal of the TCPIPClientReceive node to
the In terminal of the MQOutput node.
- On the MQInput node,
set the Queue name property
(on the Basic tab) to TCPIP.TASK6.IN1.
- Set the following properties of the TCPIPClientOutput node:
- On the Basic tab, set the Connection details property to 14146.
- On the Records and elements tab,
set the following properties:
- Set the Record detection property
to Fixed length.
- Set the Length property
to 100.
- Set the following properties of the TCPIPClientReceive node:
- On the Basic tab, set the Connection details property to 14146.
- On the Advanced tab, set the
following properties:
- Set the Output stream modification property
to Reserve output stream and release
at end of flow.
- Set the Input stream modification property
to Reserve input stream and release
at end of flow.
- On the Request tab, set the ID location property to $LocalEnvironment/WrittenDestination/TCPIP/Output/ConnectionDetails[1]/Id.
- On the Records and elements tab,
set the following properties:
- Set the Record detection property
to Fixed length.
- Set the Length property
to 100.
- On the MQOutput node,
set the Queue name property
(on the Basic tab) to TCPIP.TASK6.OUT1.
- Save the message flow.