|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem with timed-out GET command on queue |
« View previous topic :: View next topic » |
Author |
Message
|
mikehkk |
Posted: Wed Dec 17, 2003 8:10 am Post subject: Problem with timed-out GET command on queue |
|
|
Apprentice
Joined: 29 Jul 2002 Posts: 25
|
I have a VB application using MQSeries COM objects. The app's generic getMessage() method has an optional parm passed to it specifying the time interval that a GET command will "hold" on a queue - after which it releases its grip if there are no messages to be had (to prevent an infinite "blocking" GET in other words).
When this method was first coded, what was odd is that sometimes MQ would generate error-like behavior during the message-less, timed GET. Examination of the MQ Session object's .Reason property value in the error handler invariably had either of the two values:
MQRC_NONE or MQRC_NO_MSG_AVAILABLE
I never understood why this error-like behavior was being raised however. It was random too, no consistency about it.
Anyway, I put the following hack in the procedure's error handler to test for the above "error" circumstance:
'Test to see if an event was raised that is really an error condition...
If (MQSession.ReasonCode = MQRC_NONE Or MQSession.ReasonCode = MQRC_NO_MSG_AVAILABLE) Then
'No error, code here creates a normal exit from method...
Else
'There was a real error of some kind (continue raising an error)
End If
And the above code did its job... until recently however. Now the same thing is happening - but with a twist: The "error" test is failing in the first If() evaluation and winding-up in the Else() case. However, the Session.ReasonCode() property value there still reads MQRC_NONE or MQRC_NO_MSG_AVAILABLE.
Has anyone encountered this behavior before? Is there some property I'm not setting(could be set?) on the queue at it's creation that would prevent this behavior in the first place? Make the queue's operation more robust?
Appreciate any and everyone's two cents on this. Thanks! |
|
Back to top |
|
 |
JasonE |
Posted: Wed Dec 17, 2003 8:30 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Is your app activeX and multithreaded?
I found the following in an internal article, and might apply here (I assume its still correct, havent investigated - sorry!)
Quote: |
When checking the ActiveX COM MQSession CompCode and ReasonCode. The user should be aware that there is only ever one Session object. This object is updated after each MQ call. For a multithreaded application this may cause a problem. On receiving an error the CompCode and ReasonCode may be updated by the next MQ call on a different thread.
This only applies to the Session object. Other MQ objects are not shared in the system so hold a unique CompCode and ReasonCode. One way to handle this is to change the VB application to continue after an error and inspect the VB variable Err. Err is thread/appartment/process safe so the values stored e.g. Err.Description can be relied upon. |
|
|
Back to top |
|
 |
mikehkk |
Posted: Wed Dec 17, 2003 8:35 am Post subject: Hi Jason |
|
|
Apprentice
Joined: 29 Jul 2002 Posts: 25
|
Interesting. Guilty on both counts: ActiveX and Multi-threaded no less. Hmmmm.... thanks for that. Very interesting reading.
Mike. |
|
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
|
|
|
|