public interface MessageListenerContainer
extends org.springframework.context.SmartLifecycle
Modifier and Type | Method and Description |
---|---|
default java.util.Collection<org.apache.kafka.common.TopicPartition> |
getAssignedPartitions()
Return the assigned topics/partitions for this container.
|
default java.util.Map<java.lang.String,java.util.Collection<org.apache.kafka.common.TopicPartition>> |
getAssignmentsByClientId()
Return the assigned topics/partitions for this container, by client.id.
|
default ContainerProperties |
getContainerProperties()
Return the container properties for this container.
|
default java.lang.String |
getGroupId()
Return the
group.id property for this container whether specifically set on the
container or via a consumer property on the consumer factory. |
default java.lang.String |
getListenerId()
The 'id' attribute of a
@KafkaListener or the bean name for spring-managed
containers. |
default boolean |
isContainerPaused()
Return true if
pause() has been called; and all consumers in this container
have actually paused. |
default boolean |
isPauseRequested()
Return true if
pause() has been called; the container might not have actually
paused yet. |
java.util.Map<java.lang.String,java.util.Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric>> |
metrics()
Return metrics kept by this container's consumer(s), grouped by
client-id . |
default void |
pause()
Pause this container before the next poll().
|
default void |
resume()
Resume this container, if paused, after the next poll().
|
default void |
setAutoStartup(boolean autoStartup)
Set the autoStartup.
|
void |
setupMessageListener(java.lang.Object messageListener)
Setup the message listener to use.
|
void setupMessageListener(java.lang.Object messageListener)
IllegalArgumentException
if that message listener type is not supported.messageListener
- the object
to wrapped to the MessageListener
.java.util.Map<java.lang.String,java.util.Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric>> metrics()
client-id
.client-id
Consumer.metrics()
default ContainerProperties getContainerProperties()
@Nullable default java.util.Collection<org.apache.kafka.common.TopicPartition> getAssignedPartitions()
@Nullable default java.util.Map<java.lang.String,java.util.Collection<org.apache.kafka.common.TopicPartition>> getAssignmentsByClientId()
default void pause()
default void resume()
default boolean isPauseRequested()
pause()
has been called; the container might not have actually
paused yet.default boolean isContainerPaused()
pause()
has been called; and all consumers in this container
have actually paused.default void setAutoStartup(boolean autoStartup)
autoStartup
- the autoStartup to set.SmartLifecycle
default java.lang.String getGroupId()
group.id
property for this container whether specifically set on the
container or via a consumer property on the consumer factory.@Nullable default java.lang.String getListenerId()
@KafkaListener
or the bean name for spring-managed
containers.