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 » IBM MQ Installation/Configuration Support » Converting messageId from string to byte[]

Post new topic  Reply to topic
 Converting messageId from string to byte[] « View previous topic :: View next topic » 
Author Message
gss4u
PostPosted: Sun May 22, 2005 9:33 pm    Post subject: Converting messageId from string to byte[] Reply with quote

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
View user's profile Send private message
clindsey
PostPosted: Mon May 23, 2005 5:22 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Have you tried the java.lang.String getBytes() method?

Charlie
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 23, 2005 6:05 am    Post subject: Re: Converting messageId from string to byte[] Reply with quote

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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Mon May 23, 2005 6:15 am    Post subject: Reply with quote

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
View user's profile Send private message
WASNULFO
PostPosted: Mon May 23, 2005 7:07 am    Post subject: Set MsgId or CorrelId Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Mon May 23, 2005 7:38 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

No double posts.
I deleted your other post.

Try searching this forum for what you are trying to do.

http://www.mqseries.net/phpBB2/viewtopic.php?t=13326&highlight=correlid
Back to top
View user's profile Send private message Send e-mail Visit poster's website
WASNULFO
PostPosted: Mon May 23, 2005 7:42 am    Post subject: sorry Reply with quote

Newbie

Joined: 23 May 2005
Posts: 3

Hello Vendella:

I think that the first post not saved.

sorry
Back to top
View user's profile Send private message
clindsey
PostPosted: Mon May 23, 2005 8:53 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Quote:

'm using API C (Visual C++).

How can I set the new MsgId or CorrelId?


Go to this site http://www.developer.ibm.com/isv/tech/sampmq.html
and search for mqreqro.cpp and mqsrvro.cpp. These samples will show you how.

Charlie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Converting messageId from string to byte[]
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.