public class ConsumerPolicyBuilder extends Object
Modifier and Type | Field and 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 |
Modifier | Constructor and Description |
---|---|
protected |
ConsumerPolicyBuilder() |
Modifier and Type | Method and 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.
|
ConsumerPolicyBuilder |
waitMessageForEver()
Consumer will wait for ever message.
|
ConsumerPolicyBuilder |
waitMessageTimeout(Duration duration)
Consumer will stop if there is no more message after this timeout.
|
protected BatchPolicy batchPolicy
protected net.jodah.failsafe.RetryPolicy retryPolicy
protected boolean skipFailure
protected Duration waitMessageTimeout
protected ConsumerPolicy.StartOffset startOffset
protected boolean salted
protected short maxThreads
protected ConsumerPolicyBuilder()
public ConsumerPolicyBuilder batchPolicy(BatchPolicy policy)
public ConsumerPolicyBuilder retryPolicy(net.jodah.failsafe.RetryPolicy policy)
public ConsumerPolicyBuilder continueOnFailure(boolean value)
public ConsumerPolicyBuilder maxThreads(short maxThreads)
public ConsumerPolicyBuilder waitMessageTimeout(Duration duration)
public ConsumerPolicyBuilder waitMessageForEver()
public ConsumerPolicyBuilder startOffset(ConsumerPolicy.StartOffset startOffset)
public ConsumerPolicyBuilder salted()
public ConsumerPolicyBuilder name(String name)
public ConsumerPolicy build()
Copyright © 2019 Nuxeo. All rights reserved.