Class ConsumerPolicy
- java.lang.Object
-
- org.nuxeo.lib.stream.pattern.consumer.ConsumerPolicy
-
- Direct Known Subclasses:
DocumentConsumerPolicy
public class ConsumerPolicy extends Object
The consumer policy drive the consumer pool and runner.- Since:
- 9.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConsumerPolicy.StartOffset
-
Field Summary
Fields Modifier and Type Field Description protected BatchPolicybatchPolicystatic ConsumerPolicyBOUNDEDConsumer policy that stop on starvation and failure.static ConsumerPolicyBOUNDED_RETRYstatic StringDEFAULT_NAMEprotected shortmaxThreadsprotected Stringnamestatic net.jodah.failsafe.RetryPolicyNO_RETRYprotected net.jodah.failsafe.RetryPolicyretryPolicyprotected booleansaltedprotected booleanskipFailureprotected ConsumerPolicy.StartOffsetstartOffsetstatic ConsumerPolicyUNBOUNDEDConsumer policy that wait for ever for new message and skip failure.static ConsumerPolicyUNBOUNDED_RETRYprotected DurationwaitMessageTimeout
-
Constructor Summary
Constructors Constructor Description ConsumerPolicy(ConsumerPolicyBuilder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConsumerPolicyBuilderbuilder()booleancontinueOnFailure()BatchPolicygetBatchPolicy()shortgetMaxThreads()StringgetName()net.jodah.failsafe.RetryPolicygetRetryPolicy()ConsumerPolicy.StartOffsetgetStartOffset()DurationgetWaitMessageTimeout()booleanisSalted()StringtoString()
-
-
-
Field Detail
-
DEFAULT_NAME
public static final String DEFAULT_NAME
- See Also:
- Constant Field Values
-
NO_RETRY
public static final net.jodah.failsafe.RetryPolicy NO_RETRY
-
BOUNDED
public static final ConsumerPolicy BOUNDED
Consumer policy that stop on starvation and failure.
-
BOUNDED_RETRY
public static final ConsumerPolicy BOUNDED_RETRY
-
UNBOUNDED
public static final ConsumerPolicy UNBOUNDED
Consumer policy that wait for ever for new message and skip failure.
-
UNBOUNDED_RETRY
public static final ConsumerPolicy UNBOUNDED_RETRY
-
batchPolicy
protected final BatchPolicy batchPolicy
-
retryPolicy
protected final net.jodah.failsafe.RetryPolicy retryPolicy
-
skipFailure
protected final boolean skipFailure
-
waitMessageTimeout
protected final Duration waitMessageTimeout
-
startOffset
protected final ConsumerPolicy.StartOffset startOffset
-
salted
protected final boolean salted
-
name
protected final String name
-
maxThreads
protected final short maxThreads
-
-
Constructor Detail
-
ConsumerPolicy
public ConsumerPolicy(ConsumerPolicyBuilder builder)
-
-
Method Detail
-
getBatchPolicy
public BatchPolicy getBatchPolicy()
-
getRetryPolicy
public net.jodah.failsafe.RetryPolicy getRetryPolicy()
-
continueOnFailure
public boolean continueOnFailure()
-
getWaitMessageTimeout
public Duration getWaitMessageTimeout()
-
getStartOffset
public ConsumerPolicy.StartOffset getStartOffset()
-
isSalted
public boolean isSalted()
-
getName
public String getName()
-
getMaxThreads
public short getMaxThreads()
-
builder
public static ConsumerPolicyBuilder builder()
-
-