Author |
Message
|
gss4u |
Posted: Sun May 22, 2005 9:33 pm Post subject: Converting messageId from string to byte[] |
|
|
 Newbie
Joined: 20 May 2005 Posts: 9
|
I have the messageId in string format. But in the get method, when i set the messageid in the mqmd for retrieving the particular message corresponding to messageid, i need to specify the messageid in byte array format.. how can i conver the string messageid to byte array to set the messageid in the mqmd structure |
|
Back to top |
|
 |
clindsey |
Posted: Mon May 23, 2005 5:22 am Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
Have you tried the java.lang.String getBytes() method?
Charlie |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon May 23, 2005 6:05 am Post subject: Re: Converting messageId from string to byte[] |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gss4u wrote: |
I have the messageId in string format. But in the get method, when i set the messageid in the mqmd for retrieving the particular message corresponding to messageid, i need to specify the messageid in byte array format.. how can i conver the string messageid to byte array to set the messageid in the mqmd structure |
You do not specify which API c, java base, java JMS etc...
Anyway I would say this is a bad design. You should let MQ assign the MessageID. On top of this MessageId and CorrelationId are always treated as byte arrays. Forget about string. In this case string has no meaning because there is no conversion accross platforms and CCSIDs.
So what looks like "mymsg" on one plattform my come accross as "@!%#*" on the other !
Enjoy  |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 23, 2005 6:15 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
A couple of things to keep in mind.
If you are using JMS - you can not set the MsgId. The JMS Provider always sets this to a unique value when you execute a send.
Using MessageId as a selector in any other pattern than request/reply is an anti-pattern - it is treating a queue as a database and queues are not databases.
Also, it is likely hiding complexity that is much better off being visible. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
WASNULFO |
Posted: Mon May 23, 2005 7:07 am Post subject: Set MsgId or CorrelId |
|
|
Newbie
Joined: 23 May 2005 Posts: 3
|
Sorry, because I don't speak english very well.
I 'm using API C (Visual C++).
How can I set the new MsgId or CorrelId?
or how can I conver the string MsgId to byte array to set the MsgId
thank you very much for all
bye |
|
Back to top |
|
 |
vennela |
Posted: Mon May 23, 2005 7:38 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
|
Back to top |
|
 |
WASNULFO |
Posted: Mon May 23, 2005 7:42 am Post subject: sorry |
|
|
Newbie
Joined: 23 May 2005 Posts: 3
|
Hello Vendella:
I think that the first post not saved.
sorry |
|
Back to top |
|
 |
clindsey |
Posted: Mon May 23, 2005 8:53 am Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
|
Back to top |
|
 |
|