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")
' Error 2067 occurs on each of these lines
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.
I am using the MQAX200.dll for Windows NT that wraps the MQINQ function by setting the neccessary selector values. When I try 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.
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)?
Joined: 22 May 2002 Posts: 268 Location: NIMCONSULT - Belgium
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.
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