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 » MQGet does not return immediately if messaga is available

Post new topic  Reply to topic
 MQGet does not return immediately if messaga is available « View previous topic :: View next topic » 
Author Message
gleeuw
PostPosted: Fri Aug 07, 2009 1:14 am    Post subject: MQGet does not return immediately if messaga is available Reply with quote

Newbie

Joined: 07 Aug 2009
Posts: 3

To get MQ messages i am using dotnet amqmdnet assembly, version 1.0.0.3
The method Get(IBM.WMQ.MQMessage message, IBM.WMQ.MQGetMessageOptions gmo)
with messageoptions MQC.MQGMO_WAIT and messageOptions.WaitInterval= 10000 will always wait for 10 seconds, in all cases, whether messages are available before the call is made, after the call, and when no messages are available (expected behavior). I'd expect the call to return immedialy when messages are or become available. Could this be caused by Queue settings at the server side? Client is running on windows XP (MQ client version 5.3) server is running on windows server 2003.
Thanks,
Gerard.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Fri Aug 07, 2009 1:24 am    Post subject: Re: MQGet does not return immediately if messaga is availabl Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

gleeuw wrote:
Could this be caused by Queue settings at the server side?


No.

Please show us the rest of the code (specifically how your message object and GMO objects are built / populated).
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Aug 07, 2009 1:24 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

MQGET with WAIT will end immediately that a message that meets the criteria for selection is available.

Thousands of sites rely on this logic - it will do this.
Back to top
View user's profile Send private message
gleeuw
PostPosted: Fri Aug 07, 2009 2:30 am    Post subject: Re: MQGet does not return immediately if messaga is availabl Reply with quote

Newbie

Joined: 07 Aug 2009
Posts: 3

WMBDEV1 wrote:
gleeuw wrote:
Could this be caused by Queue settings at the server side?


No.

Please show us the rest of the code (specifically how your message object and GMO objects are built / populated).


That's clear, OK:

// code to receive messages:
MQQueueManager queueManager = new MQQueueManager(Settings.ManagerName, Settings.Channel, Settings.HostName);

MQQueue queue = queueManager.AccessQueue(Settings.QueueName,
MQC.MQOO_INPUT_AS_Q_DEF + // open queue for input
MQC.MQOO_FAIL_IF_QUIESCING); // but not if MQM stopping
string result = string.Empty;
MQGetMessageOptions MessageOptions new MQGetMessageOptions();
messageOptions.Options |= MQC.MQGMO_WAIT;
messageOptions.WaitInterval = 10000;

MQMessage message = new MQMessage();
if (Queue.IsOpen)
{
Queue.Get(message, MessageOptions);
if (message.Format.CompareTo(MQC.MQFMT_STRING) == 0)
{
result = message.ReadString(message.MessageLength);
}
else
{
string msg = MQResources.MQManagerMessageNotString + Environment.NewLine + message;
Logger.WriteWarning(msg);
}
}

// code to send messages
// MQOO_OUTPUT = Open queue to put messages.
// The queue is opened for use with subsequent MQPUT calls.
Queue = QueueManager.AccessQueue(
Settings.QueueName,
MQC.MQOO_OUTPUT + // open queue for output
MQC.MQOO_FAIL_IF_QUIESCING); // but not if MQM stopping

try
{
foreach (string bericht in berichten)
{
MQMessage message = new MQMessage(); // MQMessage instance
message.Format = MQC.MQFMT_STRING;
message.CharacterSet = MQCharacterSet;
message.WriteString(bericht);
Queue.Put(message);
}
}
finally
{
Queue.Close();
}

When sending messages to the queue (from another process), the receiving part waits for WaitInterval to have past, then returning the messages OK.

Thank you for the prompt response, and thanks again in advance.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Aug 07, 2009 3:36 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Quote:
Client is running on windows XP (MQ client version 5.3) server is running on windows server 2003.

Ok so you're running on software where the .NET stuff was introduced with (did not specify the CSD) that is no longer supported and you expect this to work flawlessly?

The answer is EASY: Get on supported software like MQ Client 6.0.2.7 or 7.xxx (see latest version on IBM site)
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
gleeuw
PostPosted: Fri Aug 07, 2009 5:41 am    Post subject: Reply with quote

Newbie

Joined: 07 Aug 2009
Posts: 3

fjb_saper wrote:
Quote:
Client is running on windows XP (MQ client version 5.3) server is running on windows server 2003.

Ok so you're running on software where the .NET stuff was introduced with (did not specify the CSD) that is no longer supported and you expect this to work flawlessly?

The answer is EASY: Get on supported software like MQ Client 6.0.2.7 or 7.xxx (see latest version on IBM site)


This seems to work. Perhaps a problem in the former installation. Thanks.
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 » MQGet does not return immediately if messaga is available
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.