Author |
Message
|
Praveen |
Posted: Wed Jan 08, 2003 3:48 am Post subject: Problem with MQPMO_SET_IDENTITY_CONTEXT |
|
|
 Apprentice
Joined: 23 Oct 2002 Posts: 40 Location: Bangalore
|
Hi All,
I am trying to put the messages on the remote queue with the following openOptions
Code: |
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_SET_IDENTITY_CONTEXT;
MQPutMessageOptions pmo =new MQPutMessageOptions();
pmo.options = MQC.MQPMO_SET_IDENTITY_CONTEXT;
|
If I use these things I am getting the error code as 2033 i,e no messages found. But if I remove
Code: |
pmo.options = MQC.MQPMO_SET_IDENTITY_CONTEXT;
|
then my program is executing properly and I am getting the messages back. I am not getting what is going wrong here. Can anybody please help me out. _________________ Thanks,
Praveen K |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Jan 10, 2003 7:28 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
If trying to get the messages you are getting a 2033, that would imply that the message is not there, and thus the put must have failed. What error are you getting on the put of the message when you have that pmo option set? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
Praveen |
Posted: Sat Jan 11, 2003 2:12 am Post subject: |
|
|
 Apprentice
Joined: 23 Oct 2002 Posts: 40 Location: Bangalore
|
Hi,
I am able to put the messages..
Code: |
system_default_local_queue.put(inMsg, pmo);
System.out.println("Message put on queue");
|
I am getting that "Message put on queue" message, after that I had set some timeout value (10sec) then it time outs and gives the message 2033. _________________ Thanks,
Praveen K |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Jan 13, 2003 6:37 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I still suspect that the message is not getting put to the queue. Is the println statement wrapped in some conditional logic that will only print if the put worked. The way you quoted your code, it looks like "Message put on queue" will get displayed after the ATTEMPT of the put, whether it worked or not. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Jan 14, 2003 5:43 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Can you post your get code as well? You can confirm that the message got to the queue by using the amqsbcg program to browse the queue. It is possible that there is something in the get code that is keeping it from getting the message. |
|
Back to top |
|
 |
Praveen |
Posted: Tue Jan 14, 2003 6:58 am Post subject: |
|
|
 Apprentice
Joined: 23 Oct 2002 Posts: 40 Location: Bangalore
|
Hi,
This is my get program,
Code: |
MQQueueManager replyQM = new MQQueueManager(qManager);
int replyOpenOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE;
MQQueue replyQueue = replyQM.accessQueue("queue",replyOpenOptions, null, null, null);
MQMessage currentMessage = new MQMessage();
currentMessage.messageId = MQC.MQCI_NONE;
currentMessage.correlationId = MQC.MQCI_NONE;
currentMessage.format = MQC.MQFMT_STRING;
currentMessage.encoding = MQC.MQENC_NATIVE;
MQGetMessageOptions gmo = new MQGetMessageOptions( );
gmo.options = MQC.MQGMO_WAIT;
// gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID;
gmo.waitInterval = 10 * 1000;
replyQueue.get(currentMessage, gmo);
System.out.println("Message retrieved from the queue");
|
_________________ Thanks,
Praveen K |
|
Back to top |
|
 |
vennela |
Posted: Tue Jan 14, 2003 4:46 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Praveen:
Couple of things
1. How do you know that there is actually a message in the queue that you are trying to GET?
2. Is the wait time interval enough?
What you really need to look at is the application that is processing the messages and replying back.
My guess is the back hand application that is processing the messages that you PUT, differentiates between the messages with Idcontext set and without any Idcontext.
Make sure that the message is arrived on the queue you are expecting the message to arrive at.
---
Venny |
|
Back to top |
|
 |
Praveen |
Posted: Tue Jan 14, 2003 10:57 pm Post subject: |
|
|
 Apprentice
Joined: 23 Oct 2002 Posts: 40 Location: Bangalore
|
Venny,
The time out set is proper, because that is the time within which I need to receive the messages back from the other application. And even my earlier C++ program is using the same Idcontext, so it should be fine for this also, right?. But now the thing is why do I need this "MQC.MQPMO_SET_IDENTITY_CONTEXT". What is the advantage of using this, if I don’t use it will it affect anything? . And what is the reason if I remove this I am getting the messages properly. _________________ Thanks,
Praveen K |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Jan 15, 2003 4:48 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I suspect when you have that option set your PUT is failing. Display the CC and RC of your PUT to verify that the message actually is being PUT succesfully or to find out why it is failing.
I don't see how PUT options in 1 program would prevent another program from getting a message, unless the message was never PUT in the first place (and committed). _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
T.Rob |
Posted: Mon Jan 27, 2003 11:02 am Post subject: |
|
|
 Acolyte
Joined: 16 Oct 2001 Posts: 56 Location: Charlotte, NC
|
Praveen,
When using SET or PASS for context, not only the queue but also the QMgr must be properly authorized. Have you checked that your authorizations on the QMgr specify SET_IDENTITY_CONTEXT? _________________ -- T.Rob
Voice/SMS 704-443-TROB (8762)
https://t-rob.net
https://linkedin.com/in/tdotrob
@tdotrob on Twitter |
|
Back to top |
|
 |
|