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 class
ConsumerPolicy.StartOffset
-
Field Summary
Fields Modifier and Type Field Description protected BatchPolicy
batchPolicy
static ConsumerPolicy
BOUNDED
Consumer policy that stop on starvation and failure.static ConsumerPolicy
BOUNDED_RETRY
static String
DEFAULT_NAME
protected short
maxThreads
protected String
name
static net.jodah.failsafe.RetryPolicy
NO_RETRY
protected net.jodah.failsafe.RetryPolicy
retryPolicy
protected boolean
salted
protected boolean
skipFailure
protected ConsumerPolicy.StartOffset
startOffset
static ConsumerPolicy
UNBOUNDED
Consumer policy that wait for ever for new message and skip failure.static ConsumerPolicy
UNBOUNDED_RETRY
protected Duration
waitMessageTimeout
-
Constructor Summary
Constructors Constructor Description ConsumerPolicy(ConsumerPolicyBuilder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConsumerPolicyBuilder
builder()
boolean
continueOnFailure()
BatchPolicy
getBatchPolicy()
short
getMaxThreads()
String
getName()
net.jodah.failsafe.RetryPolicy
getRetryPolicy()
ConsumerPolicy.StartOffset
getStartOffset()
Duration
getWaitMessageTimeout()
boolean
isSalted()
String
toString()
-
-
-
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()
-
-