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 BatchPolicy
batchPolicy
protected short
maxThreads
protected String
name
protected net.jodah.failsafe.RetryPolicy
retryPolicy
protected boolean
salted
protected boolean
skipFailure
protected ConsumerPolicy.StartOffset
startOffset
protected Duration
waitMessageTimeout
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConsumerPolicyBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConsumerPolicyBuilder
batchPolicy(BatchPolicy policy)
ConsumerPolicy
build()
ConsumerPolicyBuilder
continueOnFailure(boolean value)
Continue on next message even if the retry policy has failed.ConsumerPolicyBuilder
maxThreads(short maxThreads)
Maximum consumer threads to use.ConsumerPolicyBuilder
name(String name)
Consumer group name.ConsumerPolicyBuilder
retryPolicy(net.jodah.failsafe.RetryPolicy policy)
ConsumerPolicyBuilder
salted()
Consumer will wait some random time before start, to prevent wave of concurrency in batch processing.ConsumerPolicyBuilder
startOffset(ConsumerPolicy.StartOffset startOffset)
Where to read the first message.String
toString()
ConsumerPolicyBuilder
waitMessageForEver()
Consumer will wait for ever message.ConsumerPolicyBuilder
waitMessageTimeout(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()
-
-