K
- the key type.V
- the value type.public abstract class AbstractMessageListenerContainer<K,V> extends java.lang.Object implements MessageListenerContainer, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.SmartLifecycle
MessageListenerContainer
.Modifier and Type | Class and Description |
---|---|
static class |
AbstractMessageListenerContainer.AckMode
The offset commit behavior enumeration.
|
Modifier and Type | Field and Description |
---|---|
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 |
createConsumerRebalanceListener()
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() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
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) |
protected AbstractMessageListenerContainer(ContainerProperties containerProperties)
public void setBeanName(java.lang.String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public java.lang.String getBeanName()
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher
in interface org.springframework.context.ApplicationEventPublisherAware
public org.springframework.context.ApplicationEventPublisher getApplicationEventPublisher()
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public void setAutoStartup(boolean autoStartup)
protected void setRunning(boolean running)
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void setPhase(int phase)
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public ContainerProperties getContainerProperties()
public void setupMessageListener(java.lang.Object messageListener)
MessageListenerContainer
IllegalArgumentException
if that message listener type is not supported.setupMessageListener
in interface MessageListenerContainer
messageListener
- the object
to wrapped to the MessageListener
.public final void start()
start
in interface org.springframework.context.Lifecycle
protected abstract void doStart()
public final void stop()
stop
in interface org.springframework.context.Lifecycle
public void stop(java.lang.Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
protected abstract void doStop(java.lang.Runnable callback)
protected final org.apache.kafka.clients.consumer.ConsumerRebalanceListener createConsumerRebalanceListener()
ConsumerRebalanceListener
instance.ConsumerRebalanceListener
currently assigned to this container.