Author |
Message
|
satheesh.k |
Posted: Wed Jan 15, 2014 5:04 am Post subject: Expected 6 digit correlation id in the BLOB Format |
|
|
Novice
Joined: 15 Jan 2014 Posts: 10
|
Hi All,
Consumer is sending 6 digit correlation id which will receive in the BLOB format but expecting it in the 6 digit character.
The consumer is using the Jms application and sending only the JMS correlation Id and expecting same.
Please suggest me to get this[/code] |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 15, 2014 5:53 am Post subject: Re: Expected 6 digit correlation id in the BLOB Format |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Firstly, don't double post. We consider it rude.
Secondly,
satheesh.k wrote: |
Consumer is sending 6 digit correlation id which will receive in the BLOB format but expecting it in the 6 digit character. |
Sending it where? Java is not my thing but I didn't think JMS allowed the deliberate setting of either the message id or correlation id.
Thirdly, a BLOB in message broker is simply an unparsed binary object. If you happen to know it's the representation of a 6 digit character numeric, convert it.
Fourthly,
satheesh.k wrote: |
The consumer is using the Jms application and sending only the JMS correlation Id and expecting same. |
If that's what they want, send it to them. In whatever format they expect (or the JMS standard expects).
What's the problem? What have you tried? What happend when you tried it? What version of WMB are you using?
Better information, better advice. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
satheesh.k |
Posted: Wed Jan 15, 2014 10:28 pm Post subject: |
|
|
Novice
Joined: 15 Jan 2014 Posts: 10
|
Hi Victor,
The consumer is sending a 6 digit correlation id as JMS correlation id and we receive it in BLOB and they expect only that 6 digits as the correlation id and we are setting this value in the
SET OutputRoot.MQRFH2.jms.Cid = '654321';
But the they are receiving the correlation id which is being send as the JMScorrelationId.
Then i have cast the ('654321') this values padding with the '0' as follows
'653421000000000000000000000000000000000000000000' and casted as BLOB. Then this is being received by the consumer.
Is there any way that this value can be sent as '654321'. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 16, 2014 6:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
satheesh.k wrote: |
Hi Victor, |
So you double post and don't read people's names?
satheesh.k wrote: |
'653421000000000000000000000000000000000000000000' and casted as BLOB. Then this is being received by the consumer. |
Your consumer should know that message and correlation ids are hex arrays not character strings. Putting character values in them is not best practice.
satheesh.k wrote: |
Is there any way that this value can be sent as '654321'. |
No. The id is a hex arrray 24 bytes long, not a variable length character string. Hence if you don't supply enough length it will be automatically padded to the correct length.
Your consumer should expect that. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 16, 2014 6:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Vitor wrote: |
satheesh.k wrote: |
Hi Victor, |
So you double post and don't read people's names?
satheesh.k wrote: |
'653421000000000000000000000000000000000000000000' and casted as BLOB. Then this is being received by the consumer. |
Your consumer should know that message and correlation ids are hex arrays not character strings. Putting character values in them is not best practice.
satheesh.k wrote: |
Is there any way that this value can be sent as '654321'. |
No. The id is a hex arrray 24 bytes long, not a variable length character string. Hence if you don't supply enough length it will be automatically padded to the correct length.
Your consumer should expect that. |
Exact but not quite all true.
If you look at the MQMD fully true...
However you are setting the correllationID in the RFH2 folder.
This is quite right but you also need to set the correlation ID in the MQMD.
In the MQMD the correlationID should be the hex value of the ASCII characters padded with hex 00 up to 24 bytes.
Now make it so and you might get the expected effect.
in your case
x '363534333231000000000000000000000000000000000000'
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
satheesh.k |
Posted: Sat Jan 18, 2014 10:26 pm Post subject: |
|
|
Novice
Joined: 15 Jan 2014 Posts: 10
|
Hi fjb_saper,
Thanks for the response, it was the same case of what you have responsed.
But i have appended the value with the '0' padding and the consumer is receiving it with this '0' padding.
Could you please advice me with some code of how to append this value with the hex '00'. |
|
Back to top |
|
 |
aggarwal.intouch |
Posted: Sun Jan 19, 2014 10:37 pm Post subject: |
|
|
 Acolyte
Joined: 30 May 2011 Posts: 56 Location: India
|
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Jan 19, 2014 10:46 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Sigh, a simple ESQL cast would do the job just as well.
There are plenty of examples in this forum of casting a hex string to a blob. _________________ 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 |
|
 |
fjb_saper |
Posted: Mon Jan 20, 2014 6:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
satheesh.k wrote: |
Hi fjb_saper,
Thanks for the response, it was the same case of what you have responsed.
But i have appended the value with the '0' padding and the consumer is receiving it with this '0' padding.
Could you please advice me with some code of how to append this value with the hex '00'. |
for the consumer not to receive it with 0 padding you NEED to ask for the message with a JMS- Selector and CANNOT use the native form but must use the string form JMSCorrelId = '654321' If you use the native form:
JMSCorrelId = 'ID:363534333231000000.... you have to use the hex representation of the byte array...
Your best bet is to set the correlation ID before the put and retrieve it after the put. The one you retrieve from the message after the put is what you are going to look for.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|