ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » MQRC_NO_MSG_AVAILABLE

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 MQRC_NO_MSG_AVAILABLE « View previous topic :: View next topic » 
Author Message
anirudhworld
PostPosted: Fri Nov 26, 2010 3:29 am    Post subject: MQRC_NO_MSG_AVAILABLE Reply with quote

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
View user's profile Send private message
Mr Butcher
PostPosted: Fri Nov 26, 2010 4:14 am    Post subject: Reply with quote

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
View user's profile Send private message
anirudhworld
PostPosted: Fri Nov 26, 2010 5:32 am    Post subject: Reply with quote

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
View user's profile Send private message
Mr Butcher
PostPosted: Fri Nov 26, 2010 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Nov 26, 2010 10:27 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Fri Nov 26, 2010 10:42 am    Post subject: Reply with quote

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
View user's profile Send private message
anirudhworld
PostPosted: Sun Nov 28, 2010 1:48 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sun Nov 28, 2010 5:28 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
anirudhworld
PostPosted: Sun Nov 28, 2010 12:02 pm    Post subject: Reply with quote

Novice

Joined: 26 Nov 2010
Posts: 17

Tried locally in my system with a single queue with corrid ,working fine.
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Nov 28, 2010 1:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mr Butcher
PostPosted: Sun Nov 28, 2010 11:01 pm    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

post the request message

post the reply message

post your code
_________________
Regards, Butcher
Back to top
View user's profile Send private message
anirudhworld
PostPosted: Sun Nov 28, 2010 11:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 29, 2010 1:29 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
anirudhworld
PostPosted: Mon Nov 29, 2010 2:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Mr Butcher
PostPosted: Mon Nov 29, 2010 3:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » IBM MQ API Support » MQRC_NO_MSG_AVAILABLE
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.