Sending data to a TCP/IP client connection and receiving data back on the same connection (synchronous)

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

  1. Create a message flow called TCPIP_Task6 with an MQInput node, a TCPIPClientOutput node, a TCPIPClientReceive node, and an MQOutput node.
    For more information, see Creating a message flow.
  2. Connect the Out terminal of the MQInput node to the In terminal of the TCPIPClientOutput node.
  3. Connect the Out terminal of the TCPIPClientOutput node to the In terminal of the TCPIPClientReceive node.
  4. Connect the Out terminal of the TCPIPClientReceive node to the In terminal of the MQOutput node.
    Message flow consisting of MQInput, TCPIPClientOutput, TCPIPClientReceive, and MQOutput nodes.
  5. On the MQInput node, set the Queue name property (on the Basic tab) to TCPIP.TASK6.IN1.
  6. Set the following properties of the TCPIPClientOutput node:
    1. On the Basic tab, set the Connection details property to 14146.
    2. On the Records and elements tab, set the following properties:
      • Set the Record detection property to Fixed length.
      • Set the Length property to 100.
  7. Set the following properties of the TCPIPClientReceive node:
    1. On the Basic tab, set the Connection details property to 14146.
    2. 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.
    3. On the Request tab, set the ID location property to $LocalEnvironment/WrittenDestination/TCPIP/Output/ConnectionDetails[1]/Id.
    4. On the Records and elements tab, set the following properties:
      • Set the Record detection property to Fixed length.
      • Set the Length property to 100.
  8. On the MQOutput node, set the Queue name property (on the Basic tab) to TCPIP.TASK6.OUT1.
  9. Save the message flow.