Class ContainerProperties
- java.lang.Object
-
- org.springframework.kafka.listener.ConsumerProperties
-
- org.springframework.kafka.listener.ContainerProperties
-
public class ContainerProperties extends ConsumerProperties
Contains runtime properties for a listener container.- Author:
- Gary Russell, Artem Bilan, Artem Yakshin, Johnny Lim, Lukasz Kaminski, Kyuhyeok Park
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContainerProperties.AckModeThe offset commit behavior enumeration.static classContainerProperties.AssignmentCommitOptionOffset commit behavior during assignment.static classContainerProperties.EOSModeMode for exactly once semantics.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MONITOR_INTERVALThe defaultmonitorInterval(s).static floatDEFAULT_NO_POLL_THRESHOLDThe defaultnoPollThreshold.static longDEFAULT_SHUTDOWN_TIMEOUTThe defaultshutDownTimeout(ms).-
Fields inherited from class org.springframework.kafka.listener.ConsumerProperties
DEFAULT_POLL_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description ContainerProperties(java.lang.String... topics)Create properties for a container that will subscribe to the specified topics.ContainerProperties(java.util.regex.Pattern topicPattern)Create properties for a container that will subscribe to topics matching the specified pattern.ContainerProperties(TopicPartitionOffset... topicPartitions)Create properties for a container that will assign itself the provided topic partitions.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetAckCount()ContainerProperties.AckModegetAckMode()longgetAckTime()org.aopalliance.aop.Advice[]getAdviceChain()A chain of listenerAdvices.ContainerProperties.AssignmentCommitOptiongetAssignmentCommitOption()java.time.DurationgetConsumerStartTimeout()java.time.DurationgetConsumerStartTimout()Deprecated.org.springframework.core.task.AsyncListenableTaskExecutorgetConsumerTaskExecutor()Return the consumer task executor.ContainerProperties.EOSModegetEosMode()Get the exactly once semantics mode.doublegetIdleBeforeDataMultiplier()Multiply thesetIdleEventInterval(Long)by this value until at least one record is received.longgetIdleBetweenPolls()java.lang.LonggetIdleEventInterval()Return the idle event interval.java.lang.LonggetIdlePartitionEventInterval()Return the idle partition event interval.java.lang.ObjectgetMessageListener()java.util.Map<java.lang.String,java.lang.String>getMicrometerTags()intgetMonitorInterval()floatgetNoPollThreshold()org.springframework.scheduling.TaskSchedulergetScheduler()Return the task scheduler, if present.longgetShutdownTimeout()java.lang.BooleangetSubBatchPerPartition()Return whether to split batches by partition; null if not set.org.springframework.transaction.TransactionDefinitiongetTransactionDefinition()Get the transaction definition.org.springframework.transaction.PlatformTransactionManagergetTransactionManager()booleanisAsyncAcks()When true, async manual acknowledgments are supported.booleanisDeliveryAttemptHeader()booleanisLogContainerConfig()Log the container configuration if true (INFO).booleanisMicrometerEnabled()booleanisMissingTopicsFatal()If true, the container won't start if any of the configured topics are not present on the broker.booleanisStopContainerWhenFenced()When true, the container will stop after aProducerFencedException.booleanisStopImmediate()When true, the container will be stopped immediately after processing the current record.booleanisSubBatchPerPartition()Return whether to split batches by partition.voidsetAckCount(int count)Set the number of outstanding record count after which offsets should be committed whenContainerProperties.AckMode.COUNTorContainerProperties.AckMode.COUNT_TIMEis being used.voidsetAckMode(ContainerProperties.AckMode ackMode)Set the ack mode to use when auto ack (in the configuration properties) is false.voidsetAckTime(long ackTime)Set the time (ms) after which outstanding offsets should be committed whenContainerProperties.AckMode.TIMEorContainerProperties.AckMode.COUNT_TIMEis being used.voidsetAdviceChain(org.aopalliance.aop.Advice... adviceChain)Set a chain of listenerAdvices; must not be null or have null elements.voidsetAssignmentCommitOption(ContainerProperties.AssignmentCommitOption assignmentCommitOption)Set the assignment commit option.voidsetAsyncAcks(boolean asyncAcks)Set to true to support asynchronous record acknowledgments.voidsetConsumerStartTimeout(java.time.Duration consumerStartTimeout)Set the timeout to wait for a consumer thread to start before logging an error.voidsetConsumerStartTimout(java.time.Duration consumerStartTimeout)Deprecated.voidsetConsumerTaskExecutor(org.springframework.core.task.AsyncListenableTaskExecutor consumerTaskExecutor)Set the executor for threads that poll the consumer.voidsetDeliveryAttemptHeader(boolean deliveryAttemptHeader)Set to true to populate theKafkaHeaders.DELIVERY_ATTEMPTheader when the error handler or after rollback processor implementsDeliveryAttemptAware.voidsetEosMode(ContainerProperties.EOSMode eosMode)Set the exactly once semantics mode.voidsetIdleBeforeDataMultiplier(double idleBeforeDataMultiplier)Multiply thesetIdleEventInterval(Long)by this value until at least one record is received.voidsetIdleBetweenPolls(long idleBetweenPolls)The sleep interval in milliseconds used in the main loop betweenConsumer.poll(Duration)calls.voidsetIdleEventInterval(java.lang.Long idleEventInterval)Set the idle event interval; when set, an event is emitted if a poll returns no records and this interval has elapsed since a record was returned.voidsetIdlePartitionEventInterval(java.lang.Long idlePartitionEventInterval)Set the idle partition event interval; when set, an event is emitted if a poll returns no records for a partition and this interval has elapsed since a record was returned.voidsetLogContainerConfig(boolean logContainerConfig)Set to true to instruct each container to log this configuration.voidsetMessageListener(java.lang.Object messageListener)Set the message listener; must be aMessageListenerorAcknowledgingMessageListener.voidsetMicrometerEnabled(boolean micrometerEnabled)Set to false to disable the Micrometer listener timers.voidsetMicrometerTags(java.util.Map<java.lang.String,java.lang.String> tags)Set additional tags for the Micrometer listener timers.voidsetMissingTopicsFatal(boolean missingTopicsFatal)Set to true to prevent the container from starting if any of the configured topics are not present on the broker.voidsetMonitorInterval(int monitorInterval)The interval between checks for a non-responsive consumer in seconds; default 30.voidsetNoPollThreshold(float noPollThreshold)If the time since the last poll /poll timeoutexceeds this value, a NonResponsiveConsumerEvent is published.voidsetScheduler(org.springframework.scheduling.TaskScheduler scheduler)A scheduler used with the monitor interval.voidsetShutdownTimeout(long shutdownTimeout)Set the timeout for shutting down the container.voidsetStopContainerWhenFenced(boolean stopContainerWhenFenced)Set to true to stop the container when aProducerFencedExceptionis thrown.voidsetStopImmediate(boolean stopImmediate)Set to true to stop the container after processing the current record (when stop() is called).voidsetSubBatchPerPartition(java.lang.Boolean subBatchPerPartition)When using a batch message listener whether to dispatch records by partition (with a transaction for each sub batch if transactions are in use) or the complete batch received by thepoll().voidsetSyncCommitTimeout(java.time.Duration syncCommitTimeout)Set the timeout for commitSync operations (ifConsumerProperties.isSyncCommits().voidsetTransactionDefinition(org.springframework.transaction.TransactionDefinition transactionDefinition)Set a transaction definition with properties (e.g.voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)Set the transaction manager to start a transaction; offsets are committed with semantics equivalent toContainerProperties.AckMode.RECORDandContainerProperties.AckMode.BATCHdepending on the listener type (record or batch).java.lang.StringtoString()-
Methods inherited from class org.springframework.kafka.listener.ConsumerProperties
getAuthExceptionRetryInterval, getAuthorizationExceptionRetryInterval, getClientId, getCommitCallback, getCommitLogLevel, getCommitRetries, getConsumerRebalanceListener, getGroupId, getKafkaConsumerProperties, getPollTimeout, getSyncCommitTimeout, getTopicPartitions, getTopicPattern, getTopics, isCheckDeserExWhenKeyNull, isCheckDeserExWhenValueNull, isFixTxOffsets, isOnlyLogRecordMetadata, isSyncCommits, renderProperties, setAuthExceptionRetryInterval, setAuthorizationExceptionRetryInterval, setCheckDeserExWhenKeyNull, setCheckDeserExWhenValueNull, setClientId, setCommitCallback, setCommitLogLevel, setCommitRetries, setConsumerRebalanceListener, setFixTxOffsets, setGroupId, setKafkaConsumerProperties, setOnlyLogRecordMetadata, setPollTimeout, setSyncCommits
-
-
-
-
Field Detail
-
DEFAULT_SHUTDOWN_TIMEOUT
public static final long DEFAULT_SHUTDOWN_TIMEOUT
The defaultshutDownTimeout(ms).- See Also:
- Constant Field Values
-
DEFAULT_MONITOR_INTERVAL
public static final int DEFAULT_MONITOR_INTERVAL
The defaultmonitorInterval(s).- See Also:
- Constant Field Values
-
DEFAULT_NO_POLL_THRESHOLD
public static final float DEFAULT_NO_POLL_THRESHOLD
The defaultnoPollThreshold.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ContainerProperties
public ContainerProperties(java.lang.String... topics)
Create properties for a container that will subscribe to the specified topics.- Parameters:
topics- the topics.
-
ContainerProperties
public ContainerProperties(java.util.regex.Pattern topicPattern)
Create properties for a container that will subscribe to topics matching the specified pattern. The framework will create a container that subscribes to all topics matching the specified pattern to get dynamically assigned partitions. The pattern matching will be performed periodically against topics existing at the time of check.- Parameters:
topicPattern- the pattern.- See Also:
CommonClientConfigs.METADATA_MAX_AGE_CONFIG
-
ContainerProperties
public ContainerProperties(TopicPartitionOffset... topicPartitions)
Create properties for a container that will assign itself the provided topic partitions.- Parameters:
topicPartitions- the topic partitions.
-
-
Method Detail
-
setMessageListener
public void setMessageListener(java.lang.Object messageListener)
Set the message listener; must be aMessageListenerorAcknowledgingMessageListener.- Parameters:
messageListener- the listener.
-
setAckMode
public void setAckMode(ContainerProperties.AckMode ackMode)
Set the ack mode to use when auto ack (in the configuration properties) is false.- RECORD: Commit the offset after each record has been processed by the listener.
- BATCH: Commit the offsets for each batch of records received from the consumer when they all have been processed by the listener
- TIME: Commit pending offsets after
ackTimenumber of milliseconds; (should be greater than#setPollTimeout(long) pollTimeout. - COUNT: Commit pending offsets after at least
ackCountnumber of records have been processed - COUNT_TIME: Commit pending offsets after
ackTimenumber of milliseconds or at leastackCountnumber of records have been processed - MANUAL: Listener is responsible for acking - use a
AcknowledgingMessageListener. Acks will be queued and offsets will be committed when all the records returned by the previous poll have been processed by the listener. - MANUAL_IMMDEDIATE: Listener is responsible for acking - use a
AcknowledgingMessageListener. The commit will be performed immediately if theAcknowledgmentis acknowledged on the calling consumer thread. Otherwise, the acks will be queued and offsets will be committed when all the records returned by the previous poll have been processed by the listener. Results will be indeterminate if you sometimes acknowledge on the calling thread and sometimes not.
- Parameters:
ackMode- theContainerProperties.AckMode; default BATCH.- See Also:
setTransactionManager(PlatformTransactionManager)
-
setAckCount
public void setAckCount(int count)
Set the number of outstanding record count after which offsets should be committed whenContainerProperties.AckMode.COUNTorContainerProperties.AckMode.COUNT_TIMEis being used.- Parameters:
count- the count
-
setAckTime
public void setAckTime(long ackTime)
Set the time (ms) after which outstanding offsets should be committed whenContainerProperties.AckMode.TIMEorContainerProperties.AckMode.COUNT_TIMEis being used. Should be larger than- Parameters:
ackTime- the time
-
setConsumerTaskExecutor
public void setConsumerTaskExecutor(@Nullable org.springframework.core.task.AsyncListenableTaskExecutor consumerTaskExecutor)Set the executor for threads that poll the consumer.- Parameters:
consumerTaskExecutor- the executor
-
setShutdownTimeout
public void setShutdownTimeout(long shutdownTimeout)
Set the timeout for shutting down the container. This is the maximum amount of time that the invocation to#stop(Runnable)will block for, before returning; default 10000L.- Parameters:
shutdownTimeout- the shutdown timeout.
-
setSyncCommitTimeout
public void setSyncCommitTimeout(@Nullable java.time.Duration syncCommitTimeout)Set the timeout for commitSync operations (ifConsumerProperties.isSyncCommits(). Overrides the default api timeout property. In order of precedence:- this property
ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIGinConsumerProperties.setKafkaConsumerProperties(java.util.Properties)ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIGin the consumer factory properties- 60 seconds
- Overrides:
setSyncCommitTimeoutin classConsumerProperties- Parameters:
syncCommitTimeout- the timeout.- See Also:
ConsumerProperties.setSyncCommits(boolean)
-
setIdleEventInterval
public void setIdleEventInterval(@Nullable java.lang.Long idleEventInterval)Set the idle event interval; when set, an event is emitted if a poll returns no records and this interval has elapsed since a record was returned.- Parameters:
idleEventInterval- the interval.- See Also:
setIdleBeforeDataMultiplier(double)
-
setIdleBeforeDataMultiplier
public void setIdleBeforeDataMultiplier(double idleBeforeDataMultiplier)
Multiply thesetIdleEventInterval(Long)by this value until at least one record is received. Default 5.0.- Parameters:
idleBeforeDataMultiplier- false to allow publishing.- Since:
- 2.8
- See Also:
setIdleEventInterval(Long)
-
setIdlePartitionEventInterval
public void setIdlePartitionEventInterval(@Nullable java.lang.Long idlePartitionEventInterval)Set the idle partition event interval; when set, an event is emitted if a poll returns no records for a partition and this interval has elapsed since a record was returned.- Parameters:
idlePartitionEventInterval- the interval.
-
getAckMode
public ContainerProperties.AckMode getAckMode()
-
getAckCount
public int getAckCount()
-
getAckTime
public long getAckTime()
-
getMessageListener
public java.lang.Object getMessageListener()
-
getConsumerTaskExecutor
@Nullable public org.springframework.core.task.AsyncListenableTaskExecutor getConsumerTaskExecutor()
Return the consumer task executor.- Returns:
- the executor.
-
getShutdownTimeout
public long getShutdownTimeout()
-
getIdleEventInterval
@Nullable public java.lang.Long getIdleEventInterval()
Return the idle event interval.- Returns:
- the interval.
-
getIdleBeforeDataMultiplier
public double getIdleBeforeDataMultiplier()
Multiply thesetIdleEventInterval(Long)by this value until at least one record is received. Default 5.0.- Returns:
- the noIdleBeforeData.
- Since:
- 2.8
- See Also:
getIdleEventInterval()
-
getIdlePartitionEventInterval
@Nullable public java.lang.Long getIdlePartitionEventInterval()
Return the idle partition event interval.- Returns:
- the interval.
-
getTransactionManager
@Nullable public org.springframework.transaction.PlatformTransactionManager getTransactionManager()
-
setTransactionManager
public void setTransactionManager(@Nullable org.springframework.transaction.PlatformTransactionManager transactionManager)Set the transaction manager to start a transaction; offsets are committed with semantics equivalent toContainerProperties.AckMode.RECORDandContainerProperties.AckMode.BATCHdepending on the listener type (record or batch).- Parameters:
transactionManager- the transaction manager.- Since:
- 1.3
- See Also:
setAckMode(AckMode)
-
getMonitorInterval
public int getMonitorInterval()
-
setMonitorInterval
public void setMonitorInterval(int monitorInterval)
The interval between checks for a non-responsive consumer in seconds; default 30.- Parameters:
monitorInterval- the interval.- Since:
- 1.3.1
-
getScheduler
@Nullable public org.springframework.scheduling.TaskScheduler getScheduler()
Return the task scheduler, if present.- Returns:
- the scheduler.
-
setScheduler
public void setScheduler(@Nullable org.springframework.scheduling.TaskScheduler scheduler)A scheduler used with the monitor interval.- Parameters:
scheduler- the scheduler.- Since:
- 1.3.1
- See Also:
setMonitorInterval(int)
-
getNoPollThreshold
public float getNoPollThreshold()
-
setNoPollThreshold
public void setNoPollThreshold(float noPollThreshold)
If the time since the last poll /poll timeoutexceeds this value, a NonResponsiveConsumerEvent is published. This value should be more than 1.0 to avoid a race condition that can cause spurious events to be published. Default 3.0f.- Parameters:
noPollThreshold- the threshold- Since:
- 1.3.1
-
isLogContainerConfig
public boolean isLogContainerConfig()
Log the container configuration if true (INFO).- Returns:
- true to log.
- Since:
- 2.1.1
-
setLogContainerConfig
public void setLogContainerConfig(boolean logContainerConfig)
Set to true to instruct each container to log this configuration.- Parameters:
logContainerConfig- true to log.- Since:
- 2.1.1
-
isMissingTopicsFatal
public boolean isMissingTopicsFatal()
If true, the container won't start if any of the configured topics are not present on the broker. Does not apply when topic patterns are configured. Default false.- Returns:
- the missingTopicsFatal.
- Since:
- 2.2
-
setMissingTopicsFatal
public void setMissingTopicsFatal(boolean missingTopicsFatal)
Set to true to prevent the container from starting if any of the configured topics are not present on the broker. Does not apply when topic patterns are configured. Default false;- Parameters:
missingTopicsFatal- the missingTopicsFatal.- Since:
- 2.2
-
setIdleBetweenPolls
public void setIdleBetweenPolls(long idleBetweenPolls)
The sleep interval in milliseconds used in the main loop betweenConsumer.poll(Duration)calls. Defaults to0- no idling.- Parameters:
idleBetweenPolls- the interval to sleep between polling cycles.- Since:
- 2.3
-
getIdleBetweenPolls
public long getIdleBetweenPolls()
-
isMicrometerEnabled
public boolean isMicrometerEnabled()
-
setMicrometerEnabled
public void setMicrometerEnabled(boolean micrometerEnabled)
Set to false to disable the Micrometer listener timers. Default true.- Parameters:
micrometerEnabled- false to disable.- Since:
- 2.3
-
setMicrometerTags
public void setMicrometerTags(java.util.Map<java.lang.String,java.lang.String> tags)
Set additional tags for the Micrometer listener timers.- Parameters:
tags- the tags.- Since:
- 2.3
-
getMicrometerTags
public java.util.Map<java.lang.String,java.lang.String> getMicrometerTags()
-
getConsumerStartTimeout
public java.time.Duration getConsumerStartTimeout()
-
getConsumerStartTimout
@Deprecated public java.time.Duration getConsumerStartTimout()
Deprecated.
-
setConsumerStartTimeout
public void setConsumerStartTimeout(java.time.Duration consumerStartTimeout)
Set the timeout to wait for a consumer thread to start before logging an error. Default 30 seconds.- Parameters:
consumerStartTimeout- the consumer start timeout.
-
setConsumerStartTimout
@Deprecated public void setConsumerStartTimout(java.time.Duration consumerStartTimeout)
Deprecated.
-
isSubBatchPerPartition
public boolean isSubBatchPerPartition()
Return whether to split batches by partition.- Returns:
- subBatchPerPartition.
- Since:
- 2.3.2
-
getSubBatchPerPartition
@Nullable public java.lang.Boolean getSubBatchPerPartition()
Return whether to split batches by partition; null if not set.- Returns:
- subBatchPerPartition.
- Since:
- 2.5
-
setSubBatchPerPartition
public void setSubBatchPerPartition(@Nullable java.lang.Boolean subBatchPerPartition)When using a batch message listener whether to dispatch records by partition (with a transaction for each sub batch if transactions are in use) or the complete batch received by thepoll(). Useful when using transactions to enable zombie fencing, by using atransactional.idthat is unique for each group/topic/partition. Defaults to true when using transactions withEOSMode.ALPHAand false when not using transactions or withEOSMode.BETA.- Parameters:
subBatchPerPartition- true for a separate transaction for each partition.- Since:
- 2.3.2
-
getAssignmentCommitOption
public ContainerProperties.AssignmentCommitOption getAssignmentCommitOption()
-
setAssignmentCommitOption
public void setAssignmentCommitOption(ContainerProperties.AssignmentCommitOption assignmentCommitOption)
Set the assignment commit option. DefaultContainerProperties.AssignmentCommitOption.LATEST_ONLY_NO_TX.- Parameters:
assignmentCommitOption- the option.- Since:
- 2.3.6
-
isDeliveryAttemptHeader
public boolean isDeliveryAttemptHeader()
-
setDeliveryAttemptHeader
public void setDeliveryAttemptHeader(boolean deliveryAttemptHeader)
Set to true to populate theKafkaHeaders.DELIVERY_ATTEMPTheader when the error handler or after rollback processor implementsDeliveryAttemptAware. There is a small overhead so this is false by default.- Parameters:
deliveryAttemptHeader- true to populate- Since:
- 2.5
-
getEosMode
public ContainerProperties.EOSMode getEosMode()
Get the exactly once semantics mode.- Returns:
- the mode.
- Since:
- 2.5
- See Also:
setEosMode(EOSMode)
-
setEosMode
public void setEosMode(ContainerProperties.EOSMode eosMode)
Set the exactly once semantics mode. WhenContainerProperties.EOSMode.V1a producer per group/topic/partition is used (enabling 'transactional.id fencing`).ContainerProperties.EOSMode.V2enables fetch-offset-request fencing, and requires brokers 2.5 or later. With the 2.6 client, the default is now V2 because the 2.6 client can automatically fall back to ALPHA. IMPORTANT the 3.0 clients cannot be used withContainerProperties.EOSMode.V2unless the broker is 2.5 or higher.- Parameters:
eosMode- the mode; default V2.- Since:
- 2.5
-
getTransactionDefinition
@Nullable public org.springframework.transaction.TransactionDefinition getTransactionDefinition()
Get the transaction definition.- Returns:
- the definition.
- Since:
- 2.5.4
-
setTransactionDefinition
public void setTransactionDefinition(@Nullable org.springframework.transaction.TransactionDefinition transactionDefinition)Set a transaction definition with properties (e.g. timeout) that will be copied to the container's transaction template. Note that this is only generally useful when used with aPlatformTransactionManagerthat supports a custom definition; this does NOT include theKafkaTransactionManagerwhich has no concept of transaction timeout. It can be useful to start, for example a database transaction, in the container, rather than using@Transactionalon the listener, because then a record interceptor, or filter in a listener adapter can participate in the transaction.- Parameters:
transactionDefinition- the definition.- Since:
- 2.5.4
- See Also:
setTransactionManager(PlatformTransactionManager)
-
getAdviceChain
public org.aopalliance.aop.Advice[] getAdviceChain()
A chain of listenerAdvices.- Returns:
- the adviceChain.
- Since:
- 2.5.6
-
setAdviceChain
public void setAdviceChain(org.aopalliance.aop.Advice... adviceChain)
Set a chain of listenerAdvices; must not be null or have null elements.- Parameters:
adviceChain- the adviceChain to set.- Since:
- 2.5.6
-
isStopContainerWhenFenced
public boolean isStopContainerWhenFenced()
When true, the container will stop after aProducerFencedException.- Returns:
- the stopContainerWhenFenced
- Since:
- 2.5.8
-
setStopContainerWhenFenced
public void setStopContainerWhenFenced(boolean stopContainerWhenFenced)
Set to true to stop the container when aProducerFencedExceptionis thrown. Currently, there is no way to determine if such an exception is thrown due to a rebalance Vs. a timeout. We therefore cannot call the after rollback processor. The best solution is to ensure that thetransaction.timeout.msis large enough so that transactions don't time out.- Parameters:
stopContainerWhenFenced- true to stop the container.- Since:
- 2.5.8
-
isStopImmediate
public boolean isStopImmediate()
When true, the container will be stopped immediately after processing the current record.- Returns:
- true to stop immediately.
- Since:
- 2.5.11
-
setStopImmediate
public void setStopImmediate(boolean stopImmediate)
Set to true to stop the container after processing the current record (when stop() is called). When false (default), the container will stop after all the results of the previous poll are processed.- Parameters:
stopImmediate- true to stop after the current record.- Since:
- 2.5.11
-
isAsyncAcks
public boolean isAsyncAcks()
When true, async manual acknowledgments are supported.- Returns:
- true for async ack support.
- Since:
- 2.8
-
setAsyncAcks
public void setAsyncAcks(boolean asyncAcks)
Set to true to support asynchronous record acknowledgments. Only applies withContainerProperties.AckMode.MANUALorContainerProperties.AckMode.MANUAL_IMMEDIATE. Out of order offset commits are deferred until all previous offsets in the partition have been committed. The consumer is paused, if necessary, until all acks have been completed.- Parameters:
asyncAcks- true to use async acks.- Since:
- 2.8
-
toString
public java.lang.String toString()
- Overrides:
toStringin classConsumerProperties
-
-