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,
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,