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 » IBM MQ Java / JMS » Getting from Queue

Post new topic  Reply to topic
 Getting from Queue « View previous topic :: View next topic » 
Author Message
richdedeyan
PostPosted: Fri Apr 26, 2002 1:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Fri Apr 26, 2002 1:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
richdedeyan
PostPosted: Tue Apr 30, 2002 5:32 am    Post subject: Reply with quote

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
View user's profile Send private message
StefanSievert
PostPosted: Tue Apr 30, 2002 9:19 am    Post subject: Reply with quote

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
View user's profile Send private message
richdedeyan
PostPosted: Tue Apr 30, 2002 9:34 am    Post subject: Reply with quote

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
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 » IBM MQ Java / JMS » Getting from Queue
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.