Author |
Message
|
shilpasarnobat |
Posted: Thu May 12, 2005 10:23 am Post subject: Accessing MQMD from vb.net |
|
|
Newbie
Joined: 12 May 2005 Posts: 2
|
I am using amqmdnet.dll
when i try to put a message it gets posted on the server and then is immediately deleted from the Queue on the server.
this happens only if i am setting a header to that message but if i send a message without header it is posted properly
can anyone tell me wht could be the problem |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu May 12, 2005 10:35 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
What do you mean by 'setting a header'? Do you mean you are trying to add the Message descriptor yourself? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu May 12, 2005 10:38 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Also, what do you mean by "Deleted from the server"?
Do you mean "rolled back"? Or "put on the dead letter queue"?
Does your MQPUT or equivalent give you a bad reason code?
Are you checking reason codes? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
shilpasarnobat |
Posted: Thu May 12, 2005 10:44 am Post subject: |
|
|
Newbie
Joined: 12 May 2005 Posts: 2
|
when i am using only
mqQueue.Put(mqMsg, mqPutMsgOpts)
message is send to server and i get appropriate count using this method mqQueue.CurrentDepth()
but when i set the header of the message using following method
mqMsg.messageType = MQC.MQMT_DATAGRAM
mqMsg.replyToQueueName = mqQueue.Name
mqMsg.replyToQueueManagerName = mqQMgr.Name
mqMsg.correlationId = Encoding.UTF8.GetBytes("C03434557_111424564")
mqMsg.expiry = 3
mqMsg.persistence = 1
mqQueue.Put(mqMsg, mqPutMsgOpts)
immediately after the put for a sec i will get the right count and checked the server the message appears for a sec then disappears and my count goes back to inital number of messages i am not understanding why this is happening |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu May 12, 2005 10:49 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Please go look at sample code to determine how to verify that the Put returned a good reason and completion code.
Also, please do not depend on message depths to confirm that you successfully put a message. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 12, 2005 12:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
shilpasarnobat wrote: |
when i am using only
..................
mqMsg.expiry = 3
.................
|
This is your culprit. Your message expires before you have the time to read it. !! Expired messages get removed on get or browse from the queue.
Enjoy  |
|
Back to top |
|
 |
|