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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MQPUT call fails with comp code 2 and reason code 6127

Status
Not open for further replies.

satish279

Programmer
Jul 17, 2005
3
GB
Hi,

I am new to MQSeries..

Basically i am trying to put message in MQ by setting my own Message id and ApplicationIdData. When i am trying to set the option as " objMsgOptions.Options = objMsgOptions.Options + MQPMO_NO_SYNCPOINT + MQPMO_PASS_IDENTITY_CONTEXT " it is giving this error in the line " mobjMQQueue.Put objMsg, objMsgOptions "

Could anyone tell me where i am wrong? or am i missing something..


Here is my code:
Public Sub Main()




Set mobjMQSession = CreateObject("mqax200.MQSession")
strMQQueueManagerName = "MQD101"
'Create link to Queue Manager
Set mobjMQQueueManager = mobjMQSession.AccessQueueManager(Trim(strMQQueueManagerName))

strMQQueueName = "LTSEC"
'Create a link to queue
Set mobjMQQueue = mobjMQQueueManager.AccessQueue(Trim$(strMQQueueName), MQOO_OUTPUT)


Set objMsg = mobjMQSession.AccessMessage()

' objMsg.MessageId = strMsgId


'Set the format to text string
objMsg.Format = MQFMT_STRING


strMessage = "<Name>Test</Name>"
strMsgId = "2638A164375B4A83AAF61FC3"
strApplicationIdData = "D2C163FD2B344BD3A6A3A893ABCD1234"


'Set the message data
objMsg.MessageData = strMessage
'Set the ApplicationIdData
objMsg.ApplicationIdData = strApplicationIdData

MsgBox (objMsg.ApplicationIdData)

objMsg.MessageId = strMsgId


'Get a message options object
Set objMsgOptions = mobjMQSession.AccessPutMessageOptions()


'set the options we want
objMsgOptions.Options = objMsgOptions.Options + MQPMO_NO_SYNCPOINT + MQPMO_PASS_IDENTITY_CONTEXT


'put the blighter on the queue
mobjMQQueue.Put objMsg, objMsgOptions

'cleanup
Set objMsg = Nothing
Set objMsgOptions = Nothing
Set mobjMQSession = Nothing
Set mobjMQQueue = Nothing

Thanks,
 
You need add queue open option with MQOO_SET_IDENTITY_CONTEXT option.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top