qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: receptor out of scope with no calling receptor.close();
Date Wed, 05 Oct 2011 09:18:23 GMT
On 10/04/2011 12:31 PM, joseluis wrote:
> Hi,
> With other program, I'm sending 1000 messages per second on exchante
> testing/PRD1
> In program bellow, I'm receiving those messages
> The receptor gets out of scope and is created a new one per 1000 messages
> If line  receptor.close(); is commented, the client program increase quickly
> the cpu usage and memory
> If line receptor.close(); is not commented, it works fine

That is actually as intended. To cancel a subscription you need to call 
close() on the receiver. Letting the handle  go out of scope will not 
close it (indeed you can retrieve the handle via Session::getReceiver()).

Note also that the bug you mentioned before (now fixed on trunk) causes 
the bindings for receivers whose subscription queue is both exclusive 
and auto-deleted (as your example below is) to remain until the session 
is closed.

I would suggest setting exclusive to False to workaround this until the 
bug fix is released (assuming you can't easily patch your own install). 
You can if needed introduce an x-subscribe:{exclusive:True} clause to 
your address that will prevent other subscribers to the queue while not 
marking the queue itself as exclusive.

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org

View raw message