|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[Solved]Doing Destructive Gets from a Queue |
« View previous topic :: View next topic » |
Author |
Message
|
jmeier |
Posted: Fri Sep 13, 2002 9:57 am Post subject: [Solved]Doing Destructive Gets from a Queue |
|
|
Apprentice
Joined: 30 Aug 2002 Posts: 46 Location: Minneapolis
|
I am trying to get my VB application to do a destructive get from a queue. Previously I have been only browsing. I have tried various scenarios with open and get options, and I receive different errors depending on what I try! The following are 2 code snippets and the associated error message. I am sure this is really something simple, yet I am very 'green' when it comes to MQ Series. The application is written in VB and is running on Win 2000. Thanks in advance for any help that is offered...
Scenario 1:
Open Options are set to OUTPUT and FAIL_IF_QUIESCING
Set GetMQQueue = MQQueueMgr.AccessQueue("clarify_Local", _
MQAX200.MQ.MQOO_OUTPUT Or MQAX200.MQ.MQOO_FAIL_IF_QUIESCING)
Do While GetMQQueue.CurrentDepth > 0
Set oMsg = MQSess.AccessMessage
Set oMsgOptions = MQSess.AccessGetMessageOptions
oMsgOptions.Options = oMsgOptions.Options & MQAX200.MQ.MQGMO_BROWSE_NEXT
GetMQQueue.Get oMsg, oMsgOptions
Gives the following error on Current Depth check:
ReasonCode= 6127, ReasonName=MQRC_INCONSISTENT_OPEN_OPTIONS
Scenario 2:
Open options are set to BROWSE and INQUIRE, and get message options are set to FAIL_IF_QUIESCING, NO_WAIT, NO_SYNCPOINT, ACCEPT_TRUNCATED_MSG
Set GetMQQueue = MQQueueMgr.AccessQueue("clarify_Local", _
MQAX200.MQ.MQOO_BROWSE Or MQAX200.MQ.MQOO_INQUIRE)
Do While GetMQQueue.CurrentDepth > 0
Set oMsg = MQSess.AccessMessage
Set oMsgOptions = MQSess.AccessGetMessageOptions
oMsgOptions.Options = oMsgOptions.Options & MQAX200.MQ.MQGMO_FAIL_IF_QUIESCING & MQAX200.MQ.MQGMO_NO_WAIT & MQAX200.MQ.MQGMO_NO_SYNCPOINT & MQAX200.MQ.MQGMO_ACCEPT_TRUNCATED_MSG
GetMQQueue.Get oMsg, oMsgOptions
Set putMsg = MQSess.AccessMessage
Set pMsgOptions = MQSess.AccessPutMessageOptions
pMsgOptions.Options = pMsgOptions.Options Or 0 'Or MQAX200.MQ.MQPER_PERSISTENCE_AS_Q_DEF
Gives the following error on the ‘GetMQQueue.Get oMsg, oMsgOptions’ command:
ReasonCode=2046, ReasonName=MQRC_OPTIONS_ERROR _________________ Joe Meier
Last edited by jmeier on Wed Mar 05, 2003 1:55 pm; edited 1 time in total |
|
Back to top |
|
 |
bduncan |
Posted: Fri Sep 13, 2002 3:53 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Joe,
Here's what I can ascertain from your code:
Scenario 1 - Isn't working because you are specifying MQOO_OUTPUT, and then attempting to get a message. MQOO_OUTPUT is what you use when you want to put messages. I know it sounds backwards, but here's the snippet from the API Guide:
Quote: |
MQOO_OUTPUT
Open queue to put messages.
The queue is opened for use with subsequent MQPUT calls.
An MQOPEN call with this option can succeed even if the InhibitPut queue attribute is set to MQQA_PUT_INHIBITED (although subsequent MQPUT calls will fail while the attribute is set to this value).
This option is valid for all types of queue, including distribution lists.
|
So you want to use MQOO_INPUT_SHARED or MQOO_INPUT_EXCLUSIVE.
Scenario 2 - I'm guessing that this one is failing because of the MQGMO_NO_SYNCPOINT option. Syncpoint (or the lack thereof) only makes sense when you are actually trying to remove the message from the queue. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
jmeier |
Posted: Mon Sep 16, 2002 6:52 am Post subject: |
|
|
Apprentice
Joined: 30 Aug 2002 Posts: 46 Location: Minneapolis
|
Thanks Brandon...
I removed the no_syncpoint from the options and just have the fail if quiescing, now I get the 6127 error on the get command. Here is what my code looks like...
Set GetMQQueue = MQQueueMgr.AccessQueue("clarify_Local", _
MQAX200.MQ.MQOO_BROWSE Or MQAX200.MQ.MQOO_INQUIRE)
Do While GetMQQueue.CurrentDepth > 0
Set oMsg = MQSess.AccessMessage
Set oMsgOptions = MQSess.AccessGetMessageOptions
oMsgOptions.Options = oMsgOptions.Options & MQAX200.MQ.MQGMO_FAIL_IF_QUIESCING
GetMQQueue.Get oMsg, oMsgOptions
By the way, where is the API manuals on the IBM website. I was looking for them and couldnt find them...
Thanks.... _________________ Joe Meier |
|
Back to top |
|
 |
mrlinux |
Posted: Mon Sep 16, 2002 6:57 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
|
Back to top |
|
 |
jmeier |
Posted: Mon Sep 16, 2002 10:05 am Post subject: |
|
|
Apprentice
Joined: 30 Aug 2002 Posts: 46 Location: Minneapolis
|
Thanks... that worked!!!!! _________________ Joe Meier |
|
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
|
|
|
|