[ 
https://issues.apache.org/jira/browse/AMQ-5361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Bain updated AMQ-5361:
--------------------------
    Description: 
AMQ-378 allowed a pluggable policy for aborting consumers that were slow, where 
a consumer was slow if the broker was holding a number of messages for it equal 
to the consumer's prefetch buffer size, in addition to the same number of 
messages already in the consumer's prefetch buffer.  AMQ-4621 added the ability 
to use a different slow consumer strategy and provided one other strategy, to 
consider a consumer slow if it hasn't acked a message in a certain amount of 
time.

These strategies each has certain things it protects well against while not 
protecting against others, but I want the ability to be protected from all of 
them, by being able to select multiple SlowConsumerStrategy implementations for 
my needs.  This would also allow us to use future SlowConsumerStrategy 
implementations (e.g. AMQ-5361) alongside the two that exist today.

This should be done by extracting from the SlowConsumerStrategy interface a 
SlowConsumerIdentificationStrategy interface that would determine which 
consumers were considered slow according to that strategy.  We'd end up with 
two classers implementing SlowConsumerIdentificationStrategy (e.g. 
PendingMessagesSlowConsumerIdentificationStrategy and 
AckDelaySlowConsumerIdentificationStrategy), extracted from 
AbortSlowConsumerStrategy and AbortSlowAckConsumerStrategy, respectively.  
AbortSlowAckConsumerStrategy should go away (anything in it that doesn't belong 
in AckDelaySlowConsumerIdentificationStrategy belongs in 
AbortSlowConsumerStrategy or is already there e.g. the run() method), and 
AbortSlowConsumerStrategy should get a Set<SlowConsumerIdentificationStrategy> 
to allow multiple different SlowConsumerIdentificationStrategies to be used 
together.  The union of the results of calling each 
SlowConsumerIdentificationStrategy's identifySlowConsumers() method should then 
be passed to abortSubscription().

  was:
AMQ-378 allowed a pluggable policy for aborting consumers that were slow, where 
a consumer was slow if the broker was holding a number of messages for it equal 
to the consumer's prefetch buffer size, in addition to the same number of 
messages already in the consumer's prefetch buffer.  AMQ-4621 added the ability 
to use a different slow consumer strategy and provided one other strategy, to 
consider a consumer slow if it hasn't acked a message in a certain amount of 
time.

These strategies each has certain things it protects well against while not 
protecting against others, but I want the ability to be protected from all of 
them, by being able to select multiple SlowConsumerStrategy implementations for 
my needs.  This would also allow us to use future SlowConsumerStrategy 
implementations (e.g. AMQ-5361) alongside the two that exist today.

This should be done by extracting from the SlowConsumerStrategy interface a 
SlowConsumerIdentificationStrategy interface that would determine which 
consumers were considered slow according to that strategy, and a separate 
SlowConsumerHandlerStrategy interface that would let us choose what action to 
take in response when we figure out that a consumer is slow.  We'd end up with 
two classers implementing SlowConsumerIdentificationStrategy (e.g. 
PendingMessagesSlowConsumerIdentificationStrategy and 
AckDelaySlowConsumerIdentificationStrategy), extracted from 
AbortSlowConsumerStrategy and AbortSlowAckConsumerStrategy, respectively.


> Allow for multiple slow consumer strategies to be used together
> ---------------------------------------------------------------
>
>                 Key: AMQ-5361
>                 URL: https://issues.apache.org/jira/browse/AMQ-5361
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 5.9.0
>            Reporter: Tim Bain
>
> AMQ-378 allowed a pluggable policy for aborting consumers that were slow, 
> where a consumer was slow if the broker was holding a number of messages for 
> it equal to the consumer's prefetch buffer size, in addition to the same 
> number of messages already in the consumer's prefetch buffer.  AMQ-4621 added 
> the ability to use a different slow consumer strategy and provided one other 
> strategy, to consider a consumer slow if it hasn't acked a message in a 
> certain amount of time.
> These strategies each has certain things it protects well against while not 
> protecting against others, but I want the ability to be protected from all of 
> them, by being able to select multiple SlowConsumerStrategy implementations 
> for my needs.  This would also allow us to use future SlowConsumerStrategy 
> implementations (e.g. AMQ-5361) alongside the two that exist today.
> This should be done by extracting from the SlowConsumerStrategy interface a 
> SlowConsumerIdentificationStrategy interface that would determine which 
> consumers were considered slow according to that strategy.  We'd end up with 
> two classers implementing SlowConsumerIdentificationStrategy (e.g. 
> PendingMessagesSlowConsumerIdentificationStrategy and 
> AckDelaySlowConsumerIdentificationStrategy), extracted from 
> AbortSlowConsumerStrategy and AbortSlowAckConsumerStrategy, respectively.  
> AbortSlowAckConsumerStrategy should go away (anything in it that doesn't 
> belong in AckDelaySlowConsumerIdentificationStrategy belongs in 
> AbortSlowConsumerStrategy or is already there e.g. the run() method), and 
> AbortSlowConsumerStrategy should get a 
> Set<SlowConsumerIdentificationStrategy> to allow multiple different 
> SlowConsumerIdentificationStrategies to be used together.  The union of the 
> results of calling each SlowConsumerIdentificationStrategy's 
> identifySlowConsumers() method should then be passed to abortSubscription().



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to