K - the key type.V - the value type.public abstract class AbstractMessageListenerContainer<K,V> extends java.lang.Object implements GenericMessageListenerContainer<K,V>, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationEventPublisherAware
MessageListenerContainer.| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractMessageListenerContainer.AckMode
The offset commit behavior enumeration.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PHASE
The default
SmartLifecycle phase for listener containers 2147483547. |
protected org.apache.commons.logging.Log |
logger |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMessageListenerContainer(ContainerProperties containerProperties) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.kafka.clients.consumer.ConsumerRebalanceListener |
createSimpleLoggingConsumerRebalanceListener()
Return default implementation of
ConsumerRebalanceListener instance. |
protected abstract void |
doStart() |
protected abstract void |
doStop(java.lang.Runnable callback) |
org.springframework.context.ApplicationEventPublisher |
getApplicationEventPublisher() |
java.lang.String |
getBeanName() |
ContainerProperties |
getContainerProperties()
Return the container properties for this container.
|
int |
getPhase() |
boolean |
isAutoStartup() |
protected boolean |
isPaused() |
boolean |
isRunning() |
void |
pause()
Pause this container before the next poll().
|
void |
resume()
Resume this container, if paused, after the next poll().
|
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setAutoStartup(boolean autoStartup) |
void |
setBeanName(java.lang.String name) |
void |
setPhase(int phase) |
protected void |
setRunning(boolean running) |
void |
setupMessageListener(java.lang.Object messageListener)
Setup the message listener to use.
|
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAssignedPartitions, metricspublic static final int DEFAULT_PHASE
SmartLifecycle phase for listener containers 2147483547.protected final org.apache.commons.logging.Log logger
protected AbstractMessageListenerContainer(ContainerProperties containerProperties)
public void setBeanName(java.lang.String name)
setBeanName in interface org.springframework.beans.factory.BeanNameAwarepublic java.lang.String getBeanName()
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwarepublic org.springframework.context.ApplicationEventPublisher getApplicationEventPublisher()
public boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic void setAutoStartup(boolean autoStartup)
protected void setRunning(boolean running)
public boolean isRunning()
isRunning in interface org.springframework.context.Lifecycleprotected boolean isPaused()
public void setPhase(int phase)
public int getPhase()
getPhase in interface org.springframework.context.Phasedpublic ContainerProperties getContainerProperties()
MessageListenerContainergetContainerProperties in interface MessageListenerContainerpublic void setupMessageListener(java.lang.Object messageListener)
MessageListenerContainerIllegalArgumentException
if that message listener type is not supported.setupMessageListener in interface MessageListenerContainermessageListener - the object to wrapped to the MessageListener.public final void start()
start in interface org.springframework.context.Lifecycleprotected abstract void doStart()
public final void stop()
stop in interface org.springframework.context.Lifecyclepublic void pause()
MessageListenerContainerpause in interface MessageListenerContainerpublic void resume()
MessageListenerContainerresume in interface MessageListenerContainerpublic void stop(java.lang.Runnable callback)
stop in interface org.springframework.context.SmartLifecycleprotected abstract void doStop(java.lang.Runnable callback)
protected final org.apache.kafka.clients.consumer.ConsumerRebalanceListener createSimpleLoggingConsumerRebalanceListener()
ConsumerRebalanceListener instance.ConsumerRebalanceListener currently assigned to this container.