You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Gary Tully <ga...@gmail.com> on 2009/03/03 14:31:42 UTC

Re: Active consumers question

2009/2/25 Eric Chu <er...@gmail.com>

> Hi everyone,
>
> 2 part question:
>
> 1) What is the exact definition of an "Active Consumer"? I'm wondering what
> conditions would cause a broker to consider that a consumer went from
> active
> to inactive.


In ActiveMQ, in the absence of a close() call,  'active' is tied to the
connection.

>
> 2) Specifically, if a consumer receives a set of messages and does not send
> back an ACK for a period of time (let's say 5 min), is it still considered
> active?
>

Yes, but you may encounter an inactivityTimeout on the connection if using
tcp: and not failover. If a connection is inactive for more than 30 seconds
(by default) it is considered dead and will be closed. See the reference for
details on how to configure an
inactivityTimeout<http://activemq.apache.org/configuring-wire-formats.html>



> Thanks in advanced!
> Eric
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Re: Active consumers question

Posted by Garth Patil <ga...@gmail.com>.
I have added the logs with the traces to AMQ-2135:
https://issues.apache.org/activemq/secure/attachment/17713/testamq1.log
https://issues.apache.org/activemq/secure/attachment/17714/testamq2.log
https://issues.apache.org/activemq/secure/attachment/17715/testamq3.log

Attached 3 log files from running the example provided in the initial
issue (with log4j.logger.org.apache.activemq=TRACE). The result of the
test is that the first consumer (connected to 61616) consumes 5
messages, the second consumer (connected to 61617) consumes 2
messages, and 3 messages are orphaned on the 3rd broker (61618).

Given that this very simple use case of a network of brokers is
failing, I have to ask: Is anyone actually using this functionality
with success? Could you please share your configurations?
Thanks,
Garth

On Tue, Mar 3, 2009 at 9:01 AM, Garth Patil <ga...@gmail.com> wrote:
> Thanks Gary.
> Using the configuration in AMQ-2135 and turning on TRACE logging
> level, I'm able to see messages going to broker 3 and being orphaned
> there. I have also tried a permutation of that configuration that sets
>  conduitSubscriptions="false", and I get the same result.
> Also, per this thread, it appear that this is happening in 5.2 and not 5.1:
> http://www.nabble.com/ActiveMQ-5.2-Network-of-Brokers-bug-td22280154.html
> Best,
> Garth
>
> On Tue, Mar 3, 2009 at 8:50 AM, Gary Tully <ga...@gmail.com> wrote:
>> Hi Garth,
>> No. A consumer is per destination. It is active on creation till it closes
>> or its session closes or its connection closes. The relevance of the
>> connection relates to the inactivity timeout which may kick in during a long
>> ack window.
>>
>> The network support is based on advisory messages so a networked broker is
>> aware of per destination consumer creation.
>>
>> I added a comment/question to AMQ-2135.
>>
>> Gary.
>>
>> 2009/3/3 Garth Patil <ga...@gmail.com>
>>
>>> So an active consumer is per connection rather than per destination
>>> (queue/topic)? In the case of a Network of Brokers (with
>>> dynamicOnly=true), this definition seems critical, because messages
>>> should only be forwarded to remote brokers if there is an active
>>> consumer on a specific destination.
>>> From http://activemq.apache.org/networks-of-brokers.html
>>> dynamicOnly = if true, only forward messages if a consumer is active
>>> on the connected broker
>>>
>>> Is this what is going on in this bug:
>>> https://issues.apache.org/activemq/browse/AMQ-2135
>>> where messages are being dispatched to brokers with no consumers
>>> because the transport connector of the remote broker itself is being
>>> considered an appropriate "active consumer"?
>>>
>>> Thanks,
>>> Garth
>>>
>>> On Tue, Mar 3, 2009 at 5:31 AM, Gary Tully <ga...@gmail.com> wrote:
>>> > 2009/2/25 Eric Chu <er...@gmail.com>
>>> >
>>> >> Hi everyone,
>>> >>
>>> >> 2 part question:
>>> >>
>>> >> 1) What is the exact definition of an "Active Consumer"? I'm wondering
>>> what
>>> >> conditions would cause a broker to consider that a consumer went from
>>> >> active
>>> >> to inactive.
>>> >
>>> >
>>> > In ActiveMQ, in the absence of a close() call,  'active' is tied to the
>>> > connection.
>>> >
>>> >>
>>> >> 2) Specifically, if a consumer receives a set of messages and does not
>>> send
>>> >> back an ACK for a period of time (let's say 5 min), is it still
>>> considered
>>> >> active?
>>> >>
>>> >
>>> > Yes, but you may encounter an inactivityTimeout on the connection if
>>> using
>>> > tcp: and not failover. If a connection is inactive for more than 30
>>> seconds
>>> > (by default) it is considered dead and will be closed. See the reference
>>> for
>>> > details on how to configure an
>>> > inactivityTimeout<
>>> http://activemq.apache.org/configuring-wire-formats.html>
>>> >
>>> >
>>> >
>>> >> Thanks in advanced!
>>> >> Eric
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > http://blog.garytully.com
>>> >
>>> > Open Source SOA
>>> > http://FUSESource.com
>>> >
>>>
>>
>>
>>
>> --
>> http://blog.garytully.com
>>
>> Open Source SOA
>> http://FUSESource.com
>>
>

Re: Active consumers question

Posted by Garth Patil <ga...@gmail.com>.
Thanks Gary.
Using the configuration in AMQ-2135 and turning on TRACE logging
level, I'm able to see messages going to broker 3 and being orphaned
there. I have also tried a permutation of that configuration that sets
 conduitSubscriptions="false", and I get the same result.
Also, per this thread, it appear that this is happening in 5.2 and not 5.1:
http://www.nabble.com/ActiveMQ-5.2-Network-of-Brokers-bug-td22280154.html
Best,
Garth

On Tue, Mar 3, 2009 at 8:50 AM, Gary Tully <ga...@gmail.com> wrote:
> Hi Garth,
> No. A consumer is per destination. It is active on creation till it closes
> or its session closes or its connection closes. The relevance of the
> connection relates to the inactivity timeout which may kick in during a long
> ack window.
>
> The network support is based on advisory messages so a networked broker is
> aware of per destination consumer creation.
>
> I added a comment/question to AMQ-2135.
>
> Gary.
>
> 2009/3/3 Garth Patil <ga...@gmail.com>
>
>> So an active consumer is per connection rather than per destination
>> (queue/topic)? In the case of a Network of Brokers (with
>> dynamicOnly=true), this definition seems critical, because messages
>> should only be forwarded to remote brokers if there is an active
>> consumer on a specific destination.
>> From http://activemq.apache.org/networks-of-brokers.html
>> dynamicOnly = if true, only forward messages if a consumer is active
>> on the connected broker
>>
>> Is this what is going on in this bug:
>> https://issues.apache.org/activemq/browse/AMQ-2135
>> where messages are being dispatched to brokers with no consumers
>> because the transport connector of the remote broker itself is being
>> considered an appropriate "active consumer"?
>>
>> Thanks,
>> Garth
>>
>> On Tue, Mar 3, 2009 at 5:31 AM, Gary Tully <ga...@gmail.com> wrote:
>> > 2009/2/25 Eric Chu <er...@gmail.com>
>> >
>> >> Hi everyone,
>> >>
>> >> 2 part question:
>> >>
>> >> 1) What is the exact definition of an "Active Consumer"? I'm wondering
>> what
>> >> conditions would cause a broker to consider that a consumer went from
>> >> active
>> >> to inactive.
>> >
>> >
>> > In ActiveMQ, in the absence of a close() call,  'active' is tied to the
>> > connection.
>> >
>> >>
>> >> 2) Specifically, if a consumer receives a set of messages and does not
>> send
>> >> back an ACK for a period of time (let's say 5 min), is it still
>> considered
>> >> active?
>> >>
>> >
>> > Yes, but you may encounter an inactivityTimeout on the connection if
>> using
>> > tcp: and not failover. If a connection is inactive for more than 30
>> seconds
>> > (by default) it is considered dead and will be closed. See the reference
>> for
>> > details on how to configure an
>> > inactivityTimeout<
>> http://activemq.apache.org/configuring-wire-formats.html>
>> >
>> >
>> >
>> >> Thanks in advanced!
>> >> Eric
>> >>
>> >
>> >
>> >
>> > --
>> > http://blog.garytully.com
>> >
>> > Open Source SOA
>> > http://FUSESource.com
>> >
>>
>
>
>
> --
> http://blog.garytully.com
>
> Open Source SOA
> http://FUSESource.com
>

Re: Active consumers question

Posted by Gary Tully <ga...@gmail.com>.
Hi Garth,
No. A consumer is per destination. It is active on creation till it closes
or its session closes or its connection closes. The relevance of the
connection relates to the inactivity timeout which may kick in during a long
ack window.

The network support is based on advisory messages so a networked broker is
aware of per destination consumer creation.

I added a comment/question to AMQ-2135.

Gary.

2009/3/3 Garth Patil <ga...@gmail.com>

> So an active consumer is per connection rather than per destination
> (queue/topic)? In the case of a Network of Brokers (with
> dynamicOnly=true), this definition seems critical, because messages
> should only be forwarded to remote brokers if there is an active
> consumer on a specific destination.
> From http://activemq.apache.org/networks-of-brokers.html
> dynamicOnly = if true, only forward messages if a consumer is active
> on the connected broker
>
> Is this what is going on in this bug:
> https://issues.apache.org/activemq/browse/AMQ-2135
> where messages are being dispatched to brokers with no consumers
> because the transport connector of the remote broker itself is being
> considered an appropriate "active consumer"?
>
> Thanks,
> Garth
>
> On Tue, Mar 3, 2009 at 5:31 AM, Gary Tully <ga...@gmail.com> wrote:
> > 2009/2/25 Eric Chu <er...@gmail.com>
> >
> >> Hi everyone,
> >>
> >> 2 part question:
> >>
> >> 1) What is the exact definition of an "Active Consumer"? I'm wondering
> what
> >> conditions would cause a broker to consider that a consumer went from
> >> active
> >> to inactive.
> >
> >
> > In ActiveMQ, in the absence of a close() call,  'active' is tied to the
> > connection.
> >
> >>
> >> 2) Specifically, if a consumer receives a set of messages and does not
> send
> >> back an ACK for a period of time (let's say 5 min), is it still
> considered
> >> active?
> >>
> >
> > Yes, but you may encounter an inactivityTimeout on the connection if
> using
> > tcp: and not failover. If a connection is inactive for more than 30
> seconds
> > (by default) it is considered dead and will be closed. See the reference
> for
> > details on how to configure an
> > inactivityTimeout<
> http://activemq.apache.org/configuring-wire-formats.html>
> >
> >
> >
> >> Thanks in advanced!
> >> Eric
> >>
> >
> >
> >
> > --
> > http://blog.garytully.com
> >
> > Open Source SOA
> > http://FUSESource.com
> >
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Re: Active consumers question

Posted by Garth Patil <ga...@gmail.com>.
So an active consumer is per connection rather than per destination
(queue/topic)? In the case of a Network of Brokers (with
dynamicOnly=true), this definition seems critical, because messages
should only be forwarded to remote brokers if there is an active
consumer on a specific destination.
>From http://activemq.apache.org/networks-of-brokers.html
dynamicOnly = if true, only forward messages if a consumer is active
on the connected broker

Is this what is going on in this bug:
https://issues.apache.org/activemq/browse/AMQ-2135
where messages are being dispatched to brokers with no consumers
because the transport connector of the remote broker itself is being
considered an appropriate "active consumer"?

Thanks,
Garth

On Tue, Mar 3, 2009 at 5:31 AM, Gary Tully <ga...@gmail.com> wrote:
> 2009/2/25 Eric Chu <er...@gmail.com>
>
>> Hi everyone,
>>
>> 2 part question:
>>
>> 1) What is the exact definition of an "Active Consumer"? I'm wondering what
>> conditions would cause a broker to consider that a consumer went from
>> active
>> to inactive.
>
>
> In ActiveMQ, in the absence of a close() call,  'active' is tied to the
> connection.
>
>>
>> 2) Specifically, if a consumer receives a set of messages and does not send
>> back an ACK for a period of time (let's say 5 min), is it still considered
>> active?
>>
>
> Yes, but you may encounter an inactivityTimeout on the connection if using
> tcp: and not failover. If a connection is inactive for more than 30 seconds
> (by default) it is considered dead and will be closed. See the reference for
> details on how to configure an
> inactivityTimeout<http://activemq.apache.org/configuring-wire-formats.html>
>
>
>
>> Thanks in advanced!
>> Eric
>>
>
>
>
> --
> http://blog.garytully.com
>
> Open Source SOA
> http://FUSESource.com
>