Author |
Message
|
namakkal |
Posted: Fri Feb 06, 2009 10:08 am Post subject: Doubt Regarding TCPIPClientOutput node in MB 6.1 |
|
|
Novice
Joined: 06 Feb 2009 Posts: 19
|
Hi,
We are trying to send two different MRM messages into TCPIPClientOutput node.
The Flow is as follows:
MQInput-->Compute-->Propagate to terminal1 TCPIPClientOutput1
-->Propagate to terminal2 TCPIPClientPutput2-->TCPIClientReceiver
The condition is that both the messages have to go through the same connection one after the other, ie once the first message is sent to TCPIPClientOutput1(the server does not respond with any data), the control should return to the compute node and then propagate to TCPIPClientOutput2 node without closing the present connection.
We tried doing this with trace nodes and found that there were 2 different Connection IDs for both these nodes.(Does it mean they are two different connections?)
Is it possible to send two different messages in two TCPIPClientOutput nodes in the same connection?
Kindly help.
Regards,
Sathish |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Feb 06, 2009 10:44 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Why are you using two TCPClientOutput nodes, if you want to send two messages out over the same connection?
What is the format of the messages, such that you can't concatenate them together and send them once...? |
|
Back to top |
|
 |
harish_td |
Posted: Fri Feb 06, 2009 9:28 pm Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
Every TCPIPOutputNode is a TCP Client connection. As per TCP/IP behavior it will open a new connection on the TCP server. This is the reason why a trace shows different connection id's.
You cannot specify the broker to use the same connection unless you propagate the connection id you get in the first node call to the second node[copy the connection id to the output LocalEnvironment before passing control to the second TCPIPClientOutput node]
Hope that helps |
|
Back to top |
|
 |
namakkal |
Posted: Fri Feb 06, 2009 11:05 pm Post subject: |
|
|
Novice
Joined: 06 Feb 2009 Posts: 19
|
harish_td wrote: |
Every TCPIPOutputNode is a TCP Client connection. As per TCP/IP behavior it will open a new connection on the TCP server. This is the reason why a trace shows different connection id's.
You cannot specify the broker to use the same connection unless you propagate the connection id you get in the first node call to the second node[copy the connection id to the output LocalEnvironment before passing control to the second TCPIPClientOutput node]
Hope that helps |
Actually I tried setting the ConnectionID before the Propagate statement to second TCPIPClientOutput node. The code i used to do that was,
SET OuputLocalEnvironment.WrittenDestination.TCPIP.Output.ConnectionDetails.ID = <Previous ConnectionID stored in LocalEnvironment>
But this did not work out. Can you please explain a bit more on how to propagate the ConnectionID of first TCPIP node to next one with a sample code. That would be very helpful.
Thanks in advance.
Last edited by namakkal on Sun Feb 08, 2009 9:57 pm; edited 1 time in total |
|
Back to top |
|
 |
namakkal |
Posted: Fri Feb 06, 2009 11:09 pm Post subject: |
|
|
Novice
Joined: 06 Feb 2009 Posts: 19
|
mqjeff wrote: |
Why are you using two TCPClientOutput nodes, if you want to send two messages out over the same connection?
What is the format of the messages, such that you can't concatenate them together and send them once...? |
Actually in this scenario I cannot concatenate those two messages into one single message. These are basically two MRM messages, but the first message is just one ID which is sent to open a connection, the server does not respond for this Open request. Then once the connection is opened, I need to send the second MRM message over the same connection. Hope you got my problem. |
|
Back to top |
|
 |
Vitor |
Posted: Sat Feb 07, 2009 3:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Moved to correct section. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Esa |
Posted: Sat Feb 07, 2009 5:55 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
I think TCP nodes are suitable for the most simple scenarios only. For implementing a client I would recommend using java.net.socket classes in a java compute node. |
|
Back to top |
|
 |
namakkal |
Posted: Mon Feb 09, 2009 12:46 am Post subject: |
|
|
Novice
Joined: 06 Feb 2009 Posts: 19
|
harish_td wrote: |
Every TCPIPOutputNode is a TCP Client connection. As per TCP/IP behavior it will open a new connection on the TCP server. This is the reason why a trace shows different connection id's.
You cannot specify the broker to use the same connection unless you propagate the connection id you get in the first node call to the second node[copy the connection id to the output LocalEnvironment before passing control to the second TCPIPClientOutput node]
Hope that helps |
can u tell me the procedure, how to set the connection id .we tried like
OuputLocalEnvironment.WrittenDestination.TCPIP.Output.ConnectionDetails.ID, is it correct ? |
|
Back to top |
|
 |
harish_td |
Posted: Mon Feb 09, 2009 2:33 am Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
Just connect the output of the first TCPIPClientOutputNode to a compute node. That way you will be able to retain the environment details that got populated with the first TCP Session.
Else you can try this so that the environment details are not lost
Code: |
PROPAGATE TO TERMINAL 1 DELETE NONE; |
Please note that the Connection ID is something the broker maintains to identify the TCP Connection. Something similar to a correlation id for TCP Connections. By using this ID you can reuse the connections
Once you have the ENVIRONMENT tree populated you just use the Node's properties set to their defaults as per Table 1 in the Infocenter for TCPIPClientOutput node.
I am sorry i do not know how to attach a screenshot for your better understanding.
No fancy code just this line does the trick for us
Code: |
SET OutputLocalEnvironment.TCPIP = Environment.TCPIP; |
Hope that helps. |
|
Back to top |
|
 |
|