Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inquiring properties from Queue returns Error 2067

Status
Not open for further replies.

millerchris

Programmer
Oct 8, 2002
2
US
I am attempting to Inquire the properties from an open Queue. I am receiving the following error:

MQAX200.MQQueue::GetBackoutRequeueName CompletionCode = 2, ReasonCode = 2067, ReasonName = MQRC_SELECTOR_ERROR

My goal is to be able to inquire the Queue properties so I can send a message to the Backout Queue when the Backout Count exceeds the Backout Threshold. I could hardcode the Backout Queue information but would rather pull it from the Queue properties. Here is the code I am using to open the Queue from inside a Trigger program:

Code:
    lngGetOptions = _
          MQGMO_WAIT _
       Or MQGMO_ACCEPT_TRUNCATED_MSG _
       Or MQGMO_CONVERT _
       Or MQOO_INQUIRE _
       Or MQOO_INPUT_AS_Q_DEF
    
    If mobjMQSession Is Nothing Then
        Set mobjMQSession = New MQAX200.MQSession
    End If

    Set mobjMQQueueManager = mobjMQSession.AccessQueueManager("DEV01")
    Set mobjMQQueue = mobjMQQueueManager.AccessQueue("SSE.REPLY", lngGetOptions, "DEV01")

    'mobjMQQueueManager.IsConnected returns True
    'mobjMQQueueManager.IsOpen returns True
    'mobjMQQueue.IsOpen returns True

    ' Error 2067 occurs on this line
    strBackoutQueueName = mobjMQQueue.BackoutQueueName
    lngBackoutThreshold = mobjMQQueue.BackoutThreshold

The documentation states that all properties can be accessed only if the object is connected to a queue manager, and the user's user ID is authorized for Inquire or Set against that queue. If an alternate user ID is set and the current user ID is authorized to use it, the alternate user ID is checked for authorisation instead.

Both my NT Domain user ID and MUSR_MQADMIN local user ID are in the local MQM NT Group. I am not using alternate IDs.

Where do I set the authorizations for user IDs? The Trigger program is starting as MUSR_MQADMIN (correct?) Isn't this user id authorized for any process? How would I specify another user (or do I need to)?

Thank you for any helpful information provided!
 
Hi.

I am not fully sure that the problem is in the authorisation, I don't see where you are setting a selector value (maybe you have just missed that code out?) I have to confess that I am more a mainframe guy and on there you have to set the selector count, selectors and pass a couple of 'reply' fields to the MQINQ. Of course I may be barking totally up the wrong tree here.

Chapter 33 of the Application Programming Reference explains these far better than I ever could.

Good luck
 
I am using the MQAX200.dll for Windows NT that wraps the MQINQ function by setting the neccessary selector values. When I tried calling MQINQ directly with the MQIA_BACKOUT_THRESHOLD and MQCA_BACKOUT_REQ_Q_NAME selectors (using the code in the cmqb.bas sample VB file) I received the same error and reason codes.
 
I have never used the VB COM interface to MQ, but your code shows that you mix MQGMO_ options (get message options) with MQOO_ options (open options) in your open options.

Try to remove the MQGMO_ options (and read the doc for appropriate open options if this still does not work) Nicolas Maréchal
IT Architect - Project Manager - Partner
NIMCONSULT Software Architecture Services
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top