|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Getting from Queue |
« View previous topic :: View next topic » |
Author |
Message
|
richdedeyan |
Posted: Fri Apr 26, 2002 1:00 pm Post subject: |
|
|
Newbie
Joined: 24 Apr 2002 Posts: 7
|
Hi All,
I am sending messages to MQSeries connected from to a mainframe on one queue and trying to read back the response on another queue.
I have set the timeout interval to 2000ms. When I send the message, then wait, I don't get any message back until I rerun my program. No matter how high I set the timeout, I still cannot read from the queue right away. I am thinking it is how I set the options in my program. Can anyone help?
Thanks,
Rich
int openReceiveOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING ;
// Create the sender and receiver queues
mqSenderQueue = mqQueueManager.accessQueue(sendQueueName,openSendOptions);
mqReceiverQueue = mqQueueManager.accessQueue(receiveQueueName,openReceiveOptions);
public void receiveMQMessage() throws MQException, IOException, InterruptedException {
System.out.println("Receiving Message");
// Create the receive message and set the correlation id to match the logged in user
MQMessage receiveMsg = new MQMessage();
receiveMsg.characterSet = 500;
String corrId = "richd";
receiveMsg.correlationId=corrId.getBytes();
MQGetMessageOptions gmo = new MQGetMessageOptions();
// Get the messages that match the correlation id
gmo.matchOptions=MQC.MQMO_MATCH_CORREL_ID;
gmo.options = MQC.MQGMO_FAIL_IF_QUIESCING;
gmo.options = gmo.options + MQC.MQGMO_WAIT ;
gmo.waitInterval=3000;
mqReceiverQueue.get(receiveMsg,gmo);
String msgText=null;
msgText = receiveMsg.readLine();
System.out.println("Got Message: "+msgText);
} |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Apr 26, 2002 1:07 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
You didn't post your PUT code, but I bet you are putting without specifying the NO_SYNCPOINT option. If you don't tell MQ on the mainframe whether you want syncpoint or not, the default on the mainframe is SYNCPOINT.
In this case, until you commit that message (in your case by disconnecting from the Queue Manager at program end, which causes the commit), the request message is unavailable for the replying app to GET and send a reply.
_________________
Peter Potkay
MQSeries Certified Specialist,Developer
[ This Message was edited by: PeterPotkay on 2002-04-26 14:09 ] |
|
Back to top |
|
 |
richdedeyan |
Posted: Tue Apr 30, 2002 5:32 am Post subject: |
|
|
Newbie
Joined: 24 Apr 2002 Posts: 7
|
Peter,
Thanks for you reply. I attempted to use the MQC.MQGMO_NO_SYNCPOINT in the PUT options, however, I ran into the same problem. As you suggested, only by closing the sending queue connection was I able to retrieve the response.
Thanks for your help.
- Rich |
|
Back to top |
|
 |
StefanSievert |
Posted: Tue Apr 30, 2002 9:19 am Post subject: |
|
|
 Partisan
Joined: 28 Oct 2001 Posts: 333 Location: San Francisco
|
Rich,
it's the PUT that obviously runs under syncpoint, not the GET. I am guessing, but you said you specified MQC.MQGMO_NO_SYNCPOINT, suggesting that you specified it on your MQGET.
Just a thought.
Stefan
_________________ Stefan Sievert
IBM Certified * WebSphere MQ |
|
Back to top |
|
 |
richdedeyan |
Posted: Tue Apr 30, 2002 9:34 am Post subject: |
|
|
Newbie
Joined: 24 Apr 2002 Posts: 7
|
Stefan,
Actually, it was in my PUT options that I used the NO_SYNCPOINT and wasn't able to retrieve the message.
Thanks,
Rich |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|