qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Number of consumers incrementing after every reconnect
Date Wed, 10 Jan 2018 20:56:25 GMT
On 10/01/18 19:00, Mani wrote:
> I only have one consumer connected to ActiveMQ. With everytime I lose
> connection and reconnect, the "number of consumers" increments by 1 (i.e.
> +1) instead of just being one (i.e. Number of Consumers: 1). Does it have
> anything to do with idle_timeout? Please have a look at the code below. I
> even tried appending "wireFormat.maxInactivityDuration=30000" to the
> failover url but this did not help. Any help in debugging this further or
> guidance would be greatly appreciated!
> 
> Thanks!
> 
> class class1 : public proton::messaging_handler {
> std::string url;
> std::string devQueue;
> std::vector<std::string> failovers = {"failover:(amqps://1.2.3.4)"};
> 
> public:
> 
> 
> class1(const std::string& u, const std::string& devQueue) :
>          url(u), devQueue(devQueue) {}
> 
> void on_container_start(proton::container& c) override {
>      proton::connection_options co;
>      proton::reconnect_options ro;
>      ro.failover_urls(failovers);
>      c.connect(url, co.idle_timeout(proton::duration::SECOND).reconnect(ro));
> }
> 
> void on_connection_open(proton::connection& c) override {
>      c.open_receiver(devQueue);
> }
> 

I'm not as familiar with the c++ client, but I suspect that the 
reconnect logic will re-establish any links (senders/receivers) that are 
defined on the connection. So every time you are reconnecting you are 
getting the previously created receivers and then creating another one.

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


Mime
View raw message