Author |
Message
|
smdavies99 |
Posted: Wed Feb 11, 2009 5:57 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
There is a TDS Sample flow provided.
Goto Help->Samples and have a browse....
They are there  _________________ 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 |
|
 |
kash3338 |
Posted: Wed Feb 11, 2009 6:13 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
smdavies99 wrote: |
There is a TDS Sample flow provided.
Goto Help->Samples and have a browse....
They are there  |
Hi, Thanks for your guidence, but can you please be more specific on this, because i have searched the samples as well and i could not find any TDS samples used in Java Compute Node.
It would be of great help if you can provide some code snippets for reading an TDS message in JavaCompute node. I need to read an PipeDelimited message and send it to a Socket server. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Feb 11, 2009 6:46 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
You need to
- Create a message set
- Add a TDS physical format
- Create a message definition to describe the physical format of your pipe-delimited message. ( hint: you need 'All Elements Delimited' )
- Make sure that the message set is deployed
- Use MbElement.createElementAsLastChildFromBitstream() to create a message tree from the bitstream. Don't forget to specify the CCSID and Encoding.
Alternatively, you could write some Java to scan the text received from via TCP/IP and create the elements yourself using createElementAsLastChild(). If you decide to do it this way, remember that the remainder of your message flow will not get any help from the (non-existent) message set. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 11, 2009 6:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Or you could do all of those steps except the last, and then wire a ResetContentDescriptor node after the JCN. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Feb 11, 2009 7:05 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Try
Help->Samples Gallery->Technology->Message Broker->Message Formats
Then you will see the FIX & SWIFT examples. These use both XML & TDS
It is really not that hard to find  _________________ 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 |
|
 |
kash3338 |
Posted: Wed Feb 11, 2009 7:53 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
smdavies99 wrote: |
Try
Help->Samples Gallery->Technology->Message Broker->Message Formats
Then you will see the FIX & SWIFT examples. These use both XML & TDS
It is really not that hard to find  |
I tried all those samples and none of them use the JCN. I will again explain my scenario in detail...
MQInput-->Compute1-->JavaCompute-->Compute2-->MQOutput
I get an XML message in MQInput, I create a PipeDelimited message from that XML in Compute1. Now i need to send this PipeDelimited message to TCP Socket server so i use JCN. Now, how do i read this PipeDelimited message inside the JCN in order to send it to TCP server.
Can anyone please help me on this?
Regards,
Kashyap. |
|
Back to top |
|
 |
MQEnthu |
Posted: Wed Feb 11, 2009 8:53 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
As I said earlier the above posts will help you to send the construct and send the blob message to compute2 node..
Quote: |
how do i read this PipeDelimited message inside the JCN in order to send it to TCP server.
|
And though you may not find the code snippet for reading TDS message in the link I provided. It is very much similar.
MbMessage inMessage = contact admin.getMessage();
MbElement inRoot = inMessage.getRootElement(); // reference to root of incoming message equivalent to InputRoot in ESQL
MbElement inMRM = inRoot.getLastChild(); // refers to InputRoot.MRM
After this you can use inMRM.getFirstElementByPath(<specify XPATH>) or any other get methods you can traverse through InputRoot and access TDS fields. _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Feb 12, 2009 3:21 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Now that we understand the problem, then I believe that kash3338 needs the toBitstream() method on MBElement. |
|
Back to top |
|
 |
|