|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Override the Length property of the TcpipServerReceive node |
« View previous topic :: View next topic » |
Author |
Message
|
PEPERO |
Posted: Wed Jul 13, 2011 8:16 am Post subject: Override the Length property of the TcpipServerReceive node |
|
|
Disciple
Joined: 30 May 2011 Posts: 177
|
Hi;
I have to override the Length property of the TcpipServerReceive node but i've been confuesd.
The related java compute node code segment is as follows :
MbElement BLOBel = inMessage.getRootElement().getLastChild().getFirstElementByPath("BLOB");
byte[] blobData = (byte[])BLOBel.getValue();
int msgLen = 0, pow =6, temp;
for (int i = 0; i < 4 ; i++)
{
temp = (int) blobData[i];
if (temp < 0)
temp += 256;
msgLen += temp * (java.lang.Math.pow(16,pow));
pow -= 2;
}
msgLen -= 4;
MbMessage localEnv = contact admin.getLocalEnvironment();
MbMessage newLocEnv = new MbMessage(localEnv);
MbElement locEnvRoot = newLocEnv.getRootElement();
MbElement tcpip = locEnvRoot.createElementAsLastChild (MbElement.TYPE_NAME, "TCPIP",null);
MbElement receive = tcpip.createElementAsLastChild(MbElement.TYPE_NAME, "Receive",null);
receive.createElementAsLastChild(MbElement.TYPE_NAME_VALUE,
"Length", msgLen);
MbMessageAssembly outAssembly = new MbMessageAssembly(
contact admin,
newLocEnv,
contact admin.getExceptionList),
outMessage);
the messgae flow is somethine like this :
TcpipserverInput ------------> Java compute node ---------> TcpipServerReceive node .
The incomming message format is in the BLOB format with which a 4 byte length field is at the header.
Am i missing something? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 13, 2011 8:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
This is effectively a double post of this. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 13, 2011 9:17 am Post subject: Re: Override the Length property of the TcpipServerReceive n |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
PEPERO wrote: |
Am i missing something? |
What you're missing is the points we all made here when you first asked about your bizarre plan to use TCP/IP directly.
If you're still intent after all this to beat yourself to death trying to get this to work perhaps you could explain why? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Jul 13, 2011 10:13 am Post subject: Re: Override the Length property of the TcpipServerReceive n |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Vitor wrote: |
If you're still intent after all this to beat yourself to death trying to get this to work perhaps you could explain why? |
Just as I asked in my post in the old discussion that sadly wasn't answered.
IF you must use TCP/IP nodes then yes it can be done. A colleague of mine has just implemented a conection to Nominet over TCP/IP.
First you must read the length data. This is 4 bytes. This is then fed into the second read node. This reads the stream of data for the number of bytes specified. You have to work out the endianness of the 4 byte read in order to get the length right.
The sequence we used was
TCPClientReceive-->ComputeNode-->TCPClientReceive.
This was the documented method to interface with the end user.
But as your data is HTML, please please please tell us why you can't (or won't) use the HTTP nodes.
btw,
The HTTP nodes can send/receive non HTML Data if you so wish. You just have to use an HTTP header node to set the characteristics properly. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
PEPERO |
Posted: Wed Jul 13, 2011 10:44 pm Post subject: |
|
|
Disciple
Joined: 30 May 2011 Posts: 177
|
At first i'm so thankful for the valuable recommendations that all of you have given to me.
We are a company who is responsible to support and maintain a Core Banking system. There are so many channel deliveries to our core system using socket programming. Those systems are supported and maintained by the other companies in which message protocol changing is not in our hand.
So at least at this point i couldn't think to have the clients send JMS or HTTP message formats.
I didn't know that i could use the WMB's HTTP nodes for the BLOB message formats but i'd try it.
Thanks so much. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|