Author |
Message
|
nandu |
Posted: Wed Feb 09, 2005 1:43 pm Post subject: Problem in Puttine mesasge to message queue |
|
|
Newbie
Joined: 09 Feb 2005 Posts: 9
|
I am using following code for putting message to mesasge queue through VB.NET. Everything works fine but when I check the queue no messages there . Please guide me where I am going wrong or is it a queue set up problem.
Try
mqQMgr = mqSession.AccessQueueManager(qmgrName)
If mqSession.CompletionCode = MQCC_OK Then
Put_queue = Put_Queue_Name
mqQueue = mqQMgr.AccessQueue(Put_queue, MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING + MQOO_INQUIRE)
If mqSession.CompletionCode = MQCC_OK Then
ObjMqMsg = mqSession.AccessMessage()
ObjMsgOpts = mqSession.AccessPutMessageOptions()
ObjMqMsg.MessageData = strparm
ObjMqMsg.Version = MQMD_VERSION_2
ObjMqMsg.Format = MQFMT_STRING
ObjMqMsg.Expiry = -1
ObjMqMsg.ReplyToQueueManagerName = qmgrName
ObjMqMsg.ReplyToQueueName = Get_Queue_Name
ObjMqMsg.CorrelationId = corr_id
mqQueue.Put(ObjMqMsg, ObjMsgOpts)
If mqSession.CompletionCode = MQCC_OK Then
mqQMgr.Commit()
PutMessage = True
Else
strErrorMessage = "Put failed. Completion: " & mqSession.CompletionCode & " Reason: " & mqSession.ReasonCode & " " & mqSession.ReasonName
End If
Else
strErrorMessage = "AccessQueue failed. Completion: " & mqSession.CompletionCode & " Reason: " & mqSession.ReasonCode & " " & mqSession.ReasonName
End If
mqQueue.Close()
ObjMqMsg = Nothing
ObjMsgOpts = Nothing
mqQueue = Nothing
Else
strErrorMessage = "AccessQueueManager failed. Completion: " & mqSession.CompletionCode & " Reason: " & mqSession.ReasonCode & " " & mqSession.ReasonName
End If
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try[/b] |
|
Back to top |
|
 |
csmith28 |
Posted: Wed Feb 09, 2005 3:00 pm Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
@ nandu, welcome to MQSeries.net.
This is the wrong forum for a post of this nature.
Don't repost it though. A Moderator will move it to General MQSeries Support later.
Now on to your problem. What is the output of the Exception you are getting? Specifically, what is the WMQ Return or "Reason" Code?
I am not to Programmer but unless you have substituted the MQManager Name and the Queue names in the code you posted it won't work unless the actual MQManager and Queue names are "qmgrName, Put_Queue_Name and Get_Queue_Name respectively." Or atleast I don't think they will.
It may also be good to post OS/Level and WMQ Version. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial.
Last edited by csmith28 on Thu Feb 10, 2005 12:16 am; edited 1 time in total |
|
Back to top |
|
 |
kevinf2349 |
Posted: Wed Feb 09, 2005 3:59 pm Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
nandu
I believe the problem is that you are trying to put the message onto the queue under syncpoint. Try specifying no syncpoint on the Put Message Options. I would post you some code but I am not on my VB.Net machine at the moment. I will post it tomorrow unless you solve it before then.
Kevin
Last edited by kevinf2349 on Thu Feb 10, 2005 5:29 am; edited 1 time in total |
|
Back to top |
|
 |
Michael Dag |
Posted: Wed Feb 09, 2005 11:10 pm Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
|
Back to top |
|
 |
kman |
Posted: Mon Feb 14, 2005 9:52 pm Post subject: |
|
|
Partisan
Joined: 21 Jan 2003 Posts: 309 Location: Kuala Lumpur, Malaysia
|
nandu said 'Everything works fine'. I take it that there was no error. The message is successfully put to the queue name named in Put_queue.
I would imagine nandu is looking at a wrong queue for the message he just put. Otherwise it should be there in the queue.
And I don't think the syncpoint changes anything here, if everything works fine. Since the commit was asked when MQCC_OK.
User error?  |
|
Back to top |
|
 |
kevinf2349 |
Posted: Tue Feb 15, 2005 8:35 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Whoops...my bad...I failed to see the commit in there  |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 15, 2005 2:32 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Stop the channel and check if the message appears in the xmitq.
You will not see the message anywhere on the qmgr if the channel is running or inactive and triggered as it gets immediately forwarded to its destination...
If you are working with only one qmgr make sure the queue you are putting the message on is local, not being serviced and not being triggered. Otherwise the message will disappear (be consumed) just as fast as you can put it.
Enjoy  |
|
Back to top |
|
 |
|