Class ParallelConsumerOptions.ParallelConsumerOptionsBuilder<K,V>
- Enclosing class:
- ParallelConsumerOptions<K,V>
public static class ParallelConsumerOptions.ParallelConsumerOptionsBuilder<K,V>
extends java.lang.Object
-
Method Summary
-
Method Details
-
consumer
public ParallelConsumerOptions.ParallelConsumerOptionsBuilder<K,V> consumer(org.apache.kafka.clients.consumer.Consumer<K,V> consumer)Required parameter for all use.- Returns:
this.
-
producer
public ParallelConsumerOptions.ParallelConsumerOptionsBuilder<K,V> producer(org.apache.kafka.clients.producer.Producer<K,V> producer)Supplying a producer is only needed if using the produce flows.- Returns:
this.- See Also:
ParallelStreamProcessor
-
ordering
public ParallelConsumerOptions.ParallelConsumerOptionsBuilder<K,V> ordering(ParallelConsumerOptions.ProcessingOrder ordering)TheParallelConsumerOptions.ProcessingOrdertype to use- Returns:
this.
-
commitMode
public ParallelConsumerOptions.ParallelConsumerOptionsBuilder<K,V> commitMode(ParallelConsumerOptions.CommitMode commitMode)TheParallelConsumerOptions.CommitModeto be used- Returns:
this.
-
maxConcurrency
public ParallelConsumerOptions.ParallelConsumerOptionsBuilder<K,V> maxConcurrency(int maxConcurrency)Controls the maximum degree of concurrency to occur. Used to limit concurrent calls to external systems to a maximum to prevent overloading them or to a degree, using up quotas.A note on quotas - if your quota is expressed as maximum concurrent calls, this works well. If it's limited in total requests / sec, this may still overload the system. See towards the distributed rate limiting feature for this to be properly addressed: https://github.com/confluentinc/parallel-consumer/issues/24 Add distributed rate limiting support #24.
In the core module, this sets the number of threads to use in the core's thread pool.
It's recommended to set this quite high, much higher than core count, as it's expected that these threads will spend most of their time blocked waiting for IO. For automatic setting of this variable, look out for issue https://github.com/confluentinc/parallel-consumer/issues/21 Dynamic concurrency control with flow control or tcp congestion control theory #21.
- Returns:
this.
-
defaultMessageRetryDelay
public ParallelConsumerOptions.ParallelConsumerOptionsBuilder<K,V> defaultMessageRetryDelay(java.time.Duration defaultMessageRetryDelay)When a message fails, how long the system should wait before trying that message again.- Returns:
this.
-
build
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-