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 IBM MQ Support » Problem with the MQMD field

Post new topic  Reply to topic
 Problem with the MQMD field « View previous topic :: View next topic » 
Author Message
meenakshi
PostPosted: Mon Jul 25, 2005 2:57 am    Post subject: Problem with the MQMD field Reply with quote

Novice

Joined: 15 Jun 2005
Posts: 11
Location: India

Hi,
I have built a custom application to put messages on a queue. I am using MQMD set to MQMD_DEFAULT. The application is built with "mqm" to produce a server executable and "mqic" to produce a client executable.
I noticed that the "PutApplName" filed of MQMD is being populated by both the executables in a different manner.
For the server executable the "PutApplName" is blank padded like all other string fields. However in the client executable the "PutApplName" is null terminated. Also i noticed that this is the only field that is null terminated for the client executable.
This is giving me problems later when i try to compare the two messages as the MQMD fields are then different.

Could anyone tell me how to solve this problem.
Back to top
View user's profile Send private message
malammik
PostPosted: Mon Jul 25, 2005 4:59 am    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

trim it before reading.
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
jefflowrey
PostPosted: Mon Jul 25, 2005 5:01 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

malammik wrote:
trim it before reading.


I think you mean "comparing", not reading.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
meenakshi
PostPosted: Mon Jul 25, 2005 5:32 am    Post subject: Reply with quote

Novice

Joined: 15 Jun 2005
Posts: 11
Location: India

Yes,

I am trying two compare the messages on the two queues. The compare fails as the MQMD is not matching because the PutApplName for one of them is null terminated and the other is blank padded. I am using memcmp to compare the MQMDs.

You would suggest to handle the discrepancy while comparing the messages. I was thinking of a way to blank pad the PutApplName for the client application as well.

Intresting thing is that if we set the PutApplName field of the MQMD which is null terminated explicitly and use MQPMO_SET_ALL_CONTEXT and put the message, WMQ queue manager blank pads the PutApplName field. This is a problem only when i try using MQMD_DEFAULT. In this case the PutApplName field is an output only field and is populated by WMQ queue manager. The only drawback here would be that the client would need setall permission queue.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jul 25, 2005 6:03 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You basically have three choices.

1) File a PMR with IBM, and wait for them to fix what they will probably perceive as an extremely low priority problem.
2) Change your code to work around a very minor bug by using set all context, and requiring a more complicated permissions setup.
3) Write your code to be more robust in what it accepts, by doing things like trimming data to ensure consistancy.

I know what I'd do - #3 is always a good move in my book.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
meenakshi
PostPosted: Mon Jul 25, 2005 6:16 am    Post subject: Reply with quote

Novice

Joined: 15 Jun 2005
Posts: 11
Location: India

Thanks a lot,

I guess i will go with option 3 itself. Indeed the easier way out, is to do an intelligent compare. I was just checking if there was any other possible solution.

Thanks for your answers.
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 » General IBM MQ Support » Problem with the MQMD field
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.