Can you hear me: Connection management with TCPIP nodes
vivekgrover 120000FG70 Comments (2) Visits (5660)
One of the most crucial aspects of TCPIP communications in WebSphere Message Broker (WMB) is management of TCPIP connections. TCPIP nodes were first introduced in WMB V6.1 and are used in broker's communication with the TCPIP applications. Depending on the nature of your requirement, a broker can be used as a TCPIP client or a TCPIP server. The TCPIP node communication with other TCPIP applications is based on general client server connectivity principles as listed below:
TCPIP nodes in WMB establish connections with the TCPIP applications by deriving their connections from the pool that is handled at the execution group level. Each execution group process contains a connection manager, which makes the connections out of its own pool of connections. All the TCPIP server nodes (TCPIPServerInput node, TCPIPServerOutput node and TCPIPServerReceive node) that use the same port must be in the same execution group. The TCPIP input (TCPIPServerInput node, TCPIPClientInput node) and TCPIP receive nodes (TCPIPServerReceive node, TCPIPClientReceive node) are used to retrieve data, and the TCPIP output nodes (TCPIPServerOutput node, TCPIPClientOutput node) are used to send data.
Typically, there are two connection states within the connection manager of an execution group:
Each TCPIP connection has one input stream and one output stream and each of these streams has the two connection states highlighted above.
By reserving a connection stream, you can restrict access to the connection. When this connection is in reserved state, no other node can access the stream without specifying the ID of the connection. This connection ID is an internal identifier used by broker to uniquely identify the connection. While the stream is in the reserved state, no node (including the node that put the stream into the reserved state) can access it. The only nodes that can access the stream must have the connection ID, which is written to the outgoing local environment when the data is passed down the message flow.
For example: The ID location property of the TCPIPServerOutput and TCPIPServerReceive nodes can be:
When a connection is reserved, ownership of the connection is given to a current thread for processing.
The reserve mechanism provides the following options:
These parameters of reserve mechanism can be set at the node level as shown in Figure 1 below:
Figure 1 (click image to enlarge)
Some of the TCPIP connection properties can be configured via ESQL compute node. For example, you can set a TCPIP port number using the following ESQL:
Some TCPIP connection properties can also be configured on the TCPIP configurable service both for the client or server. The default configurable service may be configured using the command mqsi
The configurable connection parameters on the default configurable services for TCPIP server and TCPIP client nodes are shown in the Figure 2 (TCPIP server) and Figure 3 (TCPIP client) below:
Figure 2 (click image to enlarge)
So, if you would like to configure any of the parameters listed in the screenshot above, you can do so via MB Explorer - Brokers > Configurable Services > TCPIPServer/Default or using the command mqsi
Figure 3 (click image to enlarge)
You can also display these properties using the command mqsi
The execution group uses the configurable service or the properties defined on the node to determine which attributes are used for the socket connection. When a connection is opened by the connection pool within the connection manager, it is then sent to the respective node, which then routes a message containing details of the connection (without any data) to the Open terminal of the node. The connection pool can be configured using the attributes such as Minimumconnections, MaximumConnections in addition to the properties on the node discussed above. Also, connection expiry and port number on which the connection is established may also be configured using the configurable services. There are also socket related configurable properties such as SO_KEEPALIVE (socket checks that it is still connected after a specified time), SO_L
Once you have configured these parameters, you can design/create scenarios based on rese
Configuring a server socket so that connections expire after a specified time: If you want to configure a server socket so that connections are established and they expire after a specified time or after the message is processed.
In order to see the state of a TCPIP connection, you can run commands such as netstat -an. The following list shows the common connection states:
For example, the following output is displayed for the command:
netstat -anp tcp
TCP 126.96.36.199:7777 188.8.131.52:1132 ESTABLISHED
I hope this information helps provide some insight into TCPIP connection management. Let me know if there are any questions.