Send data through a TCP/IP
client connection and wait on the same connection for a reply to be
returned, by the use of a message flow with MQInput, TCPIPClientOutput, TCPIPClientReceive, and MQOutput nodes.
About this task
Scenario: An application sends synchronous data
on the same TCP/IP client connection.
Instructions: The
following steps describe how to create a message flow that sends out
data through a client connection and waits on the same connection
for a reply to be returned. The request is synchronous within the
same flow, as a result of the TCPIPClientReceive node waiting
for data to be returned. The outgoing message is delimited by closing
the output stream, and the reply data is delimited by the remote application
closing the input stream.
Procedure
- Create a message flow called TCPIP_Task19 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.TASK19.IN1.
- Set the following properties of the TCPIPClientOutput node:
- On the Basic tab, set the Connection details property to 14159.
- On the Advanced tab, set the
following properties:
- Select Close output stream after
a record has been sent.
- Set the Input stream modification property
to Reserve input stream and release
at end of flow. It is important to reserve the input stream
so that it is not closed before the receive node processes the return
data.
- On the Records and elements tab,
set the Record definition property
to Record is Unmodified Data.
- Set the following properties of the TCPIPClientReceive node:
- On the Basic tab, set the Connection details property to 14159.
- On the Advanced tab, set the Close connection property to After data has been received.
- 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 Record detection property
to Connection closed.
- On the MQOutput node,
set the Queue name property
(on the Basic tab) to TCPIP.TASK19.OUT1.
- Save the message flow.