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 » General Discussion » messageId

Post new topic  Reply to topic
 messageId « View previous topic :: View next topic » 
Author Message
vivekkooks
PostPosted: Tue Aug 05, 2003 1:10 am    Post subject: messageId Reply with quote

Voyager

Joined: 11 Jun 2003
Posts: 91

Hello,
I have installed MQSeries on Linux/Intel.
I want to send the message Id across messages. But when I 'get' the message, I am not getting the message Id which I set for 'put'.

Code:
PUT:
-----
ImqMessage msg;
ImqQueue queue;
ImqBinary binMsgId;
char bufferId[100] = "msgID1";
char bufferData[100]= "Hello";
binMsgId.set((char*)buffer,strlen(buffer));
msg.setMessageId(binMsgId);
msg.useEmptyBuffer( bufferData, sizeof( bufferData ) );
msg.setMessageLength( strlen(bufferData) );
queue.put(msg);

GET:
-----
ImqMessage msg;
ImqQueue queue;
ImqBinary binMsgId;
msg.setMessageId();
queue.get(msg);
cout<<"Message is:"<<msg.bufferPointer( ) <<endl;
binMsgId = msg.messageId();
cout<<"Message Id is "<<binMsgId.dataPointer()<<endl;

I am not getting message Id as "msgID1", which I am setting during put message.

Any Clue?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 05, 2003 6:23 am    Post subject: Re: messageId Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

vivekkooks wrote:
Hello,
I am not getting message Id as "msgID1", which I am setting during put message.

Any Clue?

The Message ID field in the MQMD is not a character buffer, it's a binary buffer. So what you read back is a bit stream, and not a character stream.
Back to top
View user's profile Send private message
vivekkooks
PostPosted: Tue Aug 05, 2003 7:49 am    Post subject: Reply with quote

Voyager

Joined: 11 Jun 2003
Posts: 91

Hello,
the problem is not with binary stream.
Infact I am getting null data instead.

The same problem holds true if I use setApplicationIdData(char*) in 'put' message. I am not geting the same applicationIdData() after I 'get' the message.
Back to top
View user's profile Send private message
vivekkooks
PostPosted: Wed Aug 20, 2003 3:27 am    Post subject: Reply with quote

Voyager

Joined: 11 Jun 2003
Posts: 91

The Problem is solved.
code(put):
ImqMessage msg;
char msgID[MQ_MSG_ID_LENGTH]={'\0'}; // MQ_MSG_ID_LENGTH is reqd
ImqBinary binMsgId;
binMsgId.set((char*)msgID,sizeof (msgID));
msg.setMessageId(binMsgId);
Back to top
View user's profile Send private message
rich5986
PostPosted: Wed Aug 20, 2003 9:39 am    Post subject: setApplicationIdData() not working?! Reply with quote

Newbie

Joined: 20 Aug 2003
Posts: 1

I have been having the same problem with the setApplicationIdData() method.

I call it on a message passing in something like "Zproj1", then put() the message. The system executing gets cannot see the app id, and the app id is empty if I view the message in MQSeries Explorer.

In C++, I added

#define protected public

then printed out the contents of the "MQMD2 omqmd;" protected member of ImqMessage. It worked that far: looks like the setApplicationIdData() function correctly put my value into the ImqMessage object successfully, but whatever the put() method call does, it doesn't pass it along.

Help! Any ideas?

- Rich
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Aug 21, 2003 5:50 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I thought that you had to pass in the appropriate flag on the MQPMO to indicate that you were doing something with the context. If you didn't do this, MQ set the context for you regardless of what you specified. There are details in the APR and APG.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » messageId
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.