Author |
Message
|
anirudhworld |
Posted: Fri Nov 26, 2010 3:29 am Post subject: MQRC_NO_MSG_AVAILABLE |
|
|
Novice
Joined: 26 Nov 2010 Posts: 17
|
Hi,
Am using MQ classes for .net to connect to IBM MQ system.
Way of message integration is through Request - Response.
Coming to issue MQRC_NO_MSG_AVAILABLE ,am able to push the message in request queue(confirmed from end system) but not able to retrieve it from response queue(mapping is done with correlation id).
New to IBM MQ ,can any one help in finding out the cause. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Fri Nov 26, 2010 4:14 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
did you check if there is a proper message in the response queue available? if not, maybe the response was never created? check the log of the replying application. maybe your request is in error. or never made it to that application. or or or.
if yes, check if correlid matches what you expect. check your program. check how long do you wait for the response.
lots of things to check. best .... "trace" your message processing step by step (msg created, transmitted to target, consumed by application, response created, response transmitted, ......) _________________ Regards, Butcher |
|
Back to top |
|
 |
anirudhworld |
Posted: Fri Nov 26, 2010 5:32 am Post subject: |
|
|
Novice
Joined: 26 Nov 2010 Posts: 17
|
Thanks for the reply.
End user system is able to push the message in response queue.
I have already implemented the trace message in my code from putting request to getting reply.
The point where the code is failing is, when it retrieves(Get) the message with correlated id and am waiting for time interval of 10 sec.
One more point to note message id is generated by MQ system. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Fri Nov 26, 2010 5:35 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
does the reply arrives while you are waiting?
does the correlid match?
for testing, you could try a get without correlid to verify what part of your code may be in error. _________________ Regards, Butcher |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 26, 2010 10:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And make sure you commit the request before waiting for the reply...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Nov 26, 2010 10:42 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
... and am waiting for time interval of 10 sec. |
And if the reply doesn't arrive in 10 seconds, does you app wait another 10 seconds? Or does the app end, assuming that the reply is never going to arrive in the reply-to-queue? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
anirudhworld |
Posted: Sun Nov 28, 2010 1:48 am Post subject: |
|
|
Novice
Joined: 26 Nov 2010 Posts: 17
|
Mr Butcher -> I tried pushing a request and then giving a get call but same error am getting no message available
fjb_saper - > I have just started using the .net api ,do i need to use any kind of transcation for sending a request to MQ server and getting a reply back from it
bruce2359 -> i tried to make it wait till 30 secs |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Nov 28, 2010 5:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
anirudhworld wrote: |
Mr Butcher -> I tried pushing a request and then giving a get call but same error am getting no message available
fjb_saper - > I have just started using the .net api ,do i need to use any kind of transcation for sending a request to MQ server and getting a reply back from it
bruce2359 -> i tried to make it wait till 30 secs |
If your messages are not transacted you should be fine.
Have you tried the request/response samples? Have they worked for you?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
anirudhworld |
Posted: Sun Nov 28, 2010 12:02 pm Post subject: |
|
|
Novice
Joined: 26 Nov 2010 Posts: 17
|
Tried locally in my system with a single queue with corrid ,working fine. |
|
Back to top |
|
 |
Vitor |
Posted: Sun Nov 28, 2010 1:07 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
anirudhworld wrote: |
Tried locally in my system with a single queue with corrid ,working fine. |
With the same application that sends the reply when it fails? Specifically, are you generating / using correlation id in the way as when it fails? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Sun Nov 28, 2010 11:01 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
post the request message
post the reply message
post your code _________________ Regards, Butcher |
|
Back to top |
|
 |
anirudhworld |
Posted: Sun Nov 28, 2010 11:17 pm Post subject: |
|
|
Novice
Joined: 26 Nov 2010 Posts: 17
|
Below code is when MQ automatically generates the Message ID.
In case of testing in local system ,will assign the corrid in the request message and with the same program will retrieve it.
Correct me if any changes are required in code .
Code: |
Dim queueManager As MQQueueManager = Nothing
Dim queue_REQ As MQQueue = Nothing
Dim queue_RESP As MQQueue = Nothing
Dim queuePutMessage As MQMessage = Nothing
Dim queueGetMessage As MQMessage = Nothing
Dim queuePutMessageOptions As MQPutMessageOptions = Nothing
Dim queueGetMessageOptions As MQGetMessageOptions = Nothing
Dim iWTimeInterval As Integer
Dim tResponse As String = ""
Try
queueManager = New MQQueueManager("QueueManagerName", "MessageChannel", "Servername(Portno)")
queue_REQ = queueManager.AccessQueue("RequestQueue", MQC.MQOO_OUTPUT Or MQC.MQOO_FAIL_IF_QUIESCING)
queue_RESP = queueManager.AccessQueue("ResponseQueue", MQC.MQOO_INPUT_AS_Q_DEF Or MQC.MQOO_FAIL_IF_QUIESCING)
queuePutMessage = New MQMessage
queuePutMessage.WriteUTF("Request Message")
queuePutMessage.MessageType = MQC.MQMT_REQUEST
queuePutMessage.ReplyToQueueName = "ResponseQueue"
queuePutMessage.ReplyToQueueManagerName = "QueueManagerName"
queuePutMessageOptions = New MQPutMessageOptions
queue_REQ.Put(queuePutMessage, queuePutMessageOptions)
queueGetMessage = New MQMessage
queueGetMessage.CorrelationId = queuePutMessage.MessageId
queueGetMessageOptions = New MQGetMessageOptions
queueGetMessageOptions.Options = MQC.MQGMO_FAIL_IF_QUIESCING Or MQC.MQGMO_WAIT
iWTimeInterval = 10 * 1000
queueGetMessageOptions.WaitInterval = iWTimeInterval
queueGetMessageOptions.MatchOptions = MQC.MQMO_MATCH_CORREL_ID
Try
queue_RESP.Get(queueGetMessage, queueGetMessageOptions)
tResponse = queueGetMessage.ReadUTF()
Catch ex As MQException
MessageBox.Show(ex.Message & ex.ReasonCode)
End Try
queue_RESP.Close()
queue_REQ.Close()
queueManager.Disconnect()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
|
Last edited by anirudhworld on Mon Nov 29, 2010 2:04 am; edited 3 times in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 29, 2010 1:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Enclosing your code in "code" tags makes it more readable....
Your program looks good.
Are you aware that with writeUTF you HAVE to use readUTF?
You might want to set the message format to MQFMT_STRING (constant) and use the methods for handling text.
How is the server side of the application working. Maybe you don't get a response because the server side is not geared for readUTF...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
anirudhworld |
Posted: Mon Nov 29, 2010 2:00 am Post subject: |
|
|
Novice
Joined: 26 Nov 2010 Posts: 17
|
When the request is put in a string format a space character is getting appended after each letter may be some text encoding issue i.e, using UTF format
Yes server side application is working,there are other system accessing the same server using JAVA APIs and are able to retrieve. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Mon Nov 29, 2010 3:19 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
again
Quote: |
post the request message
post the reply message |
e.g. in amqsbcg format or whatever you have. _________________ Regards, Butcher |
|
Back to top |
|
 |
|