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 » Queue.Get() method: Weird??

Post new topic  Reply to topic
 Queue.Get() method: Weird?? « View previous topic :: View next topic » 
Author Message
ddm
PostPosted: Tue Nov 02, 2004 4:19 pm    Post subject: Queue.Get() method: Weird?? Reply with quote

Apprentice

Joined: 17 Nov 2003
Posts: 40

I am using AMQMDNET.DLL on an MQSeries 5.3 Client and CSD05. I have 2 apps one is a regular windows application and the other is a web application.

I noticed a weird behavior on the Queue.Get() method. For the Windows app, it waits until the message I am retrieving is appears. On the other hand for the web app, I am getting a 2033 error, immediately. It seems it does not even try to get the message.

I tried putting a sleep before the Get(), now the 2033 is intermittent.

I am using C# on W2K platform

Thanks!
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Tue Nov 02, 2004 5:13 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

csd06 introduced many fixes for amqmdnet.dll.

csd08 is the latest. I would upgrade and then try again.

Quote:

For the Windows app, it waits until the message I am retrieving is appears.

You are specifying a Wait Interval in the GMO options?

Quote:

On the other hand for the web app, I am getting a 2033 error, immediately. It seems it does not even try to get the message.

You are NOT specifying a Wait Interval in the GMO options?
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
ddm
PostPosted: Wed Nov 03, 2004 8:03 am    Post subject: Reply with quote

Apprentice

Joined: 17 Nov 2003
Posts: 40

Thanks for the reply.

Actually, i am specifying a WAIT on the web app but still it doesn't do it.

Any more ideas why?

Is the CSD08 backwards compatible with 05? Will my old code still work?

Thanks again!
Back to top
View user's profile Send private message
kirani
PostPosted: Wed Nov 03, 2004 9:35 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Can you post the peiece of code where you specify the WAIT time?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
PeterPotkay
PostPosted: Wed Nov 03, 2004 9:35 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

If you issue an MQGET , and it returns a 2033 imediatly without waiting, then you are not setting a waitinterval. Remember, you need to set the interval value to something greater than 0 (in miliiseconds) AND set the wait option.

Quote:

Is the CSD08 backwards compatible with 05? Will my old code still work?

It should.

Make sure you re register the amqmdnet, so you are running with the new version!
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
ddm
PostPosted: Wed Nov 03, 2004 3:15 pm    Post subject: Reply with quote

Apprentice

Joined: 17 Nov 2003
Posts: 40

Thank you very much for all your input.

I just set the WaitInterval property to 'MQC.MQWI_UNLIMITED' and it worked!!!!
Back to top
View user's profile Send private message
kirani
PostPosted: Wed Nov 03, 2004 3:49 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Be careful when you set your wait time to Unlimited. You should have some mechanism to terminate your program, like putting a message on the queue with some flag (Feedback code/MessageType = something) and your program checking for that flag before terminating normally.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
bower5932
PostPosted: Thu Nov 04, 2004 2:57 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

And make sure you specify the FAIL_IF_QUIESCING option in case the qmgr is shutting down.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
ddm
PostPosted: Thu Nov 04, 2004 9:01 am    Post subject: Reply with quote

Apprentice

Joined: 17 Nov 2003
Posts: 40

kirani wrote:
Be careful when you set your wait time to Unlimited. You should have some mechanism to terminate your program, like putting a message on the queue with some flag (Feedback code/MessageType = something) and your program checking for that flag before terminating normally.


I am not familiar with what you just said. Can you give me a sample code that does this (in C# will be great!)? Also, what is the impact if I don't do your suggestion.

Thanks again! I really appreciate it.
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Nov 04, 2004 9:21 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Well, basically what I was saying is it's a good practice to specify some timeout period for your application. For example, you application will wait for 30 seconds for reply message on the queue before ending/timing-out.

But, if you want to specify "unlimited wait time" then your application should have some logic to end normally. Here is a psudo code that you can use in your program.

Code:

get message from the queue.
if (mqmd.MessageType = "some constant value")
    end application.
elseif (mqmd.MessageType = Reply)
    process reply message
endif


With this code, you can control your application by putting a "special message" on the queue where MQMD.MessageType will be some "constant value".
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Queue.Get() method: Weird??
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.