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 » Setting identity context

Post new topic  Reply to topic
 Setting identity context « View previous topic :: View next topic » 
Author Message
ml_black
PostPosted: Mon Mar 22, 2004 8:12 am    Post subject: Setting identity context Reply with quote

Novice

Joined: 09 Feb 2004
Posts: 20

I have used MQOO_SET_IDENTITY_CONTEXT and MQPMO_SET_IDENTITY_CONTEXT. I have a Java application that sets the putApplicationName. I then do MQPUT. The message gets on the queue OK, but the Put Application Name that I set seems to get overridden. Do I need to set rights for my application to be able to set the context? If my app didn't have rights, wouldn't I expect to receive some sort of error message? Any other ideas into why this isn't working? Thanks!
Back to top
View user's profile Send private message
vennela
PostPosted: Mon Mar 22, 2004 8:37 am    Post subject: Reply with quote

Jedi Knight

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

Use the options
MQOO_SET_ALL_CONTEXT (in open options)
MQPMO_SET_ALL_CONTEXT (in put message options)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ml_black
PostPosted: Mon Mar 22, 2004 8:39 am    Post subject: Reply with quote

Novice

Joined: 09 Feb 2004
Posts: 20

OK, but what if I don't want to set all of them--I want the original correlation ID, etc. to persist? Thanks.
Back to top
View user's profile Send private message
vennela
PostPosted: Mon Mar 22, 2004 8:56 am    Post subject: Reply with quote

Jedi Knight

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

To have the correlId generated by QMGR use
Code:

pmo.options = MQC.MQPMO_SET_ALL_CONTEXT | MQC.MQPMO_NEW_CORREL_ID ;

AFAIK, that is the only way to set the putApplicationName.
Maybe somebody else knows other ways.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ml_black
PostPosted: Mon Mar 22, 2004 9:09 am    Post subject: Reply with quote

Novice

Joined: 09 Feb 2004
Posts: 20

Well, I see what you are saying, but what I mean is that I want to GET an existing message off a queue, modify only the Put Application Name, and have all the other MQMD info stay the same. Then I want to PUT it onto another queue. Wouldn't SET_ALL_CONTEXT remove the original info?
Back to top
View user's profile Send private message
vennela
PostPosted: Mon Mar 22, 2004 9:27 am    Post subject: Reply with quote

Jedi Knight

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

I don't see a problem. Use the MQMessage object that you use to get. Change the putApplicationName field. Put the message again using the PMO options.

Code:



// Get the message
            int openOptions1 = MQC.MQOO_INPUT_SHARED   ;
            MQQueue outQueue = qmgr.accessQueue(QUEUE1 , openOptions1, null, null, null);
            MQMessage outMessage = new MQMessage();
            outQueue.get(outMessage);
            outQueue.close();


            int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING  |  MQC.MQOO_SET_ALL_CONTEXT    ;
            MQQueue InQueue = qmgr.accessQueue(QUEUE1 , openOptions, null, null, null);
// Change the putApplicationName field
            outMessage.putApplicationName = "My Put Application Name";
            MQPutMessageOptions pmo = new MQPutMessageOptions();
            pmo.options = MQC.MQPMO_SET_ALL_CONTEXT  ;
            InQueue.put(outMessage,pmo);
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ml_black
PostPosted: Mon Mar 22, 2004 9:43 am    Post subject: Reply with quote

Novice

Joined: 09 Feb 2004
Posts: 20

OK. Seems to work. Thanks very much!
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 Discussion » Setting identity context
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.