Class ConsumerPolicyBuilder
- java.lang.Object
-
- org.nuxeo.lib.stream.pattern.consumer.ConsumerPolicyBuilder
-
- Direct Known Subclasses:
DocumentConsumerPolicyBuilder
public class ConsumerPolicyBuilder extends Object
- Since:
- 9.2
-
-
Field Summary
Fields Modifier and Type Field Description protected BatchPolicybatchPolicyprotected shortmaxThreadsprotected Stringnameprotected net.jodah.failsafe.RetryPolicyretryPolicyprotected booleansaltedprotected booleanskipFailureprotected ConsumerPolicy.StartOffsetstartOffsetprotected DurationwaitMessageTimeout
-
Constructor Summary
Constructors Modifier Constructor Description protectedConsumerPolicyBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConsumerPolicyBuilderbatchPolicy(BatchPolicy policy)ConsumerPolicybuild()ConsumerPolicyBuildercontinueOnFailure(boolean value)Continue on next message even if the retry policy has failed.ConsumerPolicyBuildermaxThreads(short maxThreads)Maximum consumer threads to use.ConsumerPolicyBuildername(String name)Consumer group name.ConsumerPolicyBuilderretryPolicy(net.jodah.failsafe.RetryPolicy policy)ConsumerPolicyBuildersalted()Consumer will wait some random time before start, to prevent wave of concurrency in batch processing.ConsumerPolicyBuilderstartOffset(ConsumerPolicy.StartOffset startOffset)Where to read the first message.StringtoString()ConsumerPolicyBuilderwaitMessageForEver()Consumer will wait for ever message.ConsumerPolicyBuilderwaitMessageTimeout(Duration duration)Consumer will stop if there is no more message after this timeout.
-
-
-
Field Detail
-
batchPolicy
protected BatchPolicy batchPolicy
-
retryPolicy
protected net.jodah.failsafe.RetryPolicy retryPolicy
-
skipFailure
protected boolean skipFailure
-
waitMessageTimeout
protected Duration waitMessageTimeout
-
startOffset
protected ConsumerPolicy.StartOffset startOffset
-
salted
protected boolean salted
-
name
protected String name
-
maxThreads
protected short maxThreads
-
-
Method Detail
-
batchPolicy
public ConsumerPolicyBuilder batchPolicy(BatchPolicy policy)
-
retryPolicy
public ConsumerPolicyBuilder retryPolicy(net.jodah.failsafe.RetryPolicy policy)
-
continueOnFailure
public ConsumerPolicyBuilder continueOnFailure(boolean value)
Continue on next message even if the retry policy has failed.
-
maxThreads
public ConsumerPolicyBuilder maxThreads(short maxThreads)
Maximum consumer threads to use. The number of threads is limited by the size of the Log.
-
waitMessageTimeout
public ConsumerPolicyBuilder waitMessageTimeout(Duration duration)
Consumer will stop if there is no more message after this timeout.
-
waitMessageForEver
public ConsumerPolicyBuilder waitMessageForEver()
Consumer will wait for ever message.
-
startOffset
public ConsumerPolicyBuilder startOffset(ConsumerPolicy.StartOffset startOffset)
Where to read the first message.
-
salted
public ConsumerPolicyBuilder salted()
Consumer will wait some random time before start, to prevent wave of concurrency in batch processing.
-
name
public ConsumerPolicyBuilder name(String name)
Consumer group name.
-
build
public ConsumerPolicy build()
-
-