You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by AlexandreLambin <al...@gmail.com> on 2015/09/08 11:53:01 UTC

[amqp0-10] Infinite exception "Queue not found"

Hello,

I'm looking for the best solution to solve a problem I have in my usage of
qpid-cpp client api.
I have a request/reply mechanism between a server and a client but the
client has a timeout to avoid waiting too long in some case.
When the timeout is reached, the client closes the temporary reception queue
so the server get the exception "Queue not found".
The exception itself is not an issue if I receive it only once, but I have
it every time I call nextReceiver(). So my thread start to take 100% of CPU
and I cannot process the next request. The sessions seems stuck on the
exceptionfor ever.
It seems that the only way is to disconnect the session which is not
something I want to do.

I found a workaround by adding the option "create: always" when I create the
Sender to reply but I'm not sure it's the best way to do.
Any idea?

Regards,
Alex.



--
View this message in context: http://qpid.2158936.n2.nabble.com/amqp0-10-Infinite-exception-Queue-not-found-tp7630474.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [amqp0-10] Infinite exception "Queue not found"

Posted by Gordon Sim <gs...@redhat.com>.
On 09/08/2015 10:53 AM, AlexandreLambin wrote:
> Hello,
>
> I'm looking for the best solution to solve a problem I have in my usage of
> qpid-cpp client api.
> I have a request/reply mechanism between a server and a client but the
> client has a timeout to avoid waiting too long in some case.
> When the timeout is reached, the client closes the temporary reception queue
> so the server get the exception "Queue not found".
> The exception itself is not an issue if I receive it only once, but I have
> it every time I call nextReceiver(). So my thread start to take 100% of CPU
> and I cannot process the next request. The sessions seems stuck on the
> exceptionfor ever.

That is correct. For AMQP 0-10 when an 'Execution.Exception' is received 
from the server, the session can no longer be used.

> It seems that the only way is to disconnect the session which is not
> something I want to do.
>
> I found a workaround by adding the option "create: always" when I create the
> Sender to reply but I'm not sure it's the best way to do.

The problem with that is that then the queue is created and a response 
is sent to it, but nothing will ever consume that response.

One option would be to have the client bind the reply queue to some 
agreed exchange and have the reply-to use that exchange.

E.g.

    Receiver receiver = session.createReceiver("amq.direct/abc");
    Address replyTo = receiver.getAddress();
    replyTo.setType("topic");
    //...
    Message request;
    request.setReplyTo(replyTo);

The 'abc' part must be unique for each client. Any exchange can be used, 
I've just used amq.direct here for convenience since that is precreated.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org