ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Expected 6 digit correlation id in the BLOB Format

Post new topic  Reply to topic
 Expected 6 digit correlation id in the BLOB Format « View previous topic :: View next topic » 
Author Message
satheesh.k
PostPosted: Wed Jan 15, 2014 5:04 am    Post subject: Expected 6 digit correlation id in the BLOB Format Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Jan 15, 2014 5:53 am    Post subject: Re: Expected 6 digit correlation id in the BLOB Format Reply with quote

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
View user's profile Send private message
satheesh.k
PostPosted: Wed Jan 15, 2014 10:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Jan 16, 2014 6:00 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Jan 16, 2014 6:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
satheesh.k
PostPosted: Sat Jan 18, 2014 10:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
aggarwal.intouch
PostPosted: Sun Jan 19, 2014 10:37 pm    Post subject: Reply with quote

Acolyte

Joined: 30 May 2011
Posts: 56
Location: India

You could use the following code to convert string in hex format:

Code:
for (i = 0 ; i < 24 ; i++)
{
sprintf(lTmpBuf,"%02X",pMd.MsgId[i] );
strcat(lMsgId, lTmpBuf);
}


Ref:
http://www.mqseries.net/phpBB2/viewtopic.php?t=24900&view=next&sid=7f4647ad1aba6fa98e836115f21eb0ae
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Sun Jan 19, 2014 10:46 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

aggarwal.intouch wrote:
You could use the following code to convert string in hex format:

Code:
for (i = 0 ; i < 24 ; i++)
{
sprintf(lTmpBuf,"%02X",pMd.MsgId[i] );
strcat(lMsgId, lTmpBuf);
}


Ref:
http://www.mqseries.net/phpBB2/viewtopic.php?t=24900&view=next&sid=7f4647ad1aba6fa98e836115f21eb0ae


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
View user's profile Send private message
fjb_saper
PostPosted: Mon Jan 20, 2014 6:57 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Expected 6 digit correlation id in the BLOB Format
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.