public class KafkaProducerContext
extends java.lang.Object
implements org.springframework.context.SmartLifecycle, org.springframework.integration.support.context.NamedComponent, org.springframework.beans.factory.BeanNameAware
Constructor and Description |
---|
KafkaProducerContext() |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
getComponentName() |
java.lang.String |
getComponentType() |
int |
getPhase() |
java.util.Map<java.lang.String,ProducerConfiguration<?,?>> |
getProducerConfigurations() |
ProducerConfiguration<?,?> |
getTopicConfiguration(java.lang.String topic) |
boolean |
isAutoStartup() |
boolean |
isRunning() |
java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata> |
send(java.lang.String topic,
java.lang.Integer partition,
java.lang.Object messageKey,
java.lang.Object messagePayload) |
java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata> |
send(java.lang.String topic,
java.lang.Object messageKey,
java.lang.Object messagePayload) |
void |
setAutoStartup(boolean autoStartup) |
void |
setBeanName(java.lang.String name) |
void |
setPhase(int phase) |
void |
setProducerConfigurations(java.util.Map<java.lang.String,ProducerConfiguration<?,?>> producerConfigurations) |
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
public ProducerConfiguration<?,?> getTopicConfiguration(java.lang.String topic)
public java.util.Map<java.lang.String,ProducerConfiguration<?,?>> getProducerConfigurations()
public void setProducerConfigurations(java.util.Map<java.lang.String,ProducerConfiguration<?,?>> producerConfigurations)
public java.lang.String getComponentType()
getComponentType
in interface org.springframework.integration.support.context.NamedComponent
public void setBeanName(java.lang.String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
name
- the bean name.public void setPhase(int phase)
phase
- the phase to set.SmartLifecycle
public void setAutoStartup(boolean autoStartup)
autoStartup
- the autoStartup to set.SmartLifecycle
public java.lang.String getComponentName()
getComponentName
in interface org.springframework.integration.support.context.NamedComponent
protected void doStart()
protected void doStop()
public final void start()
start
in interface org.springframework.context.Lifecycle
public final void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public void stop(java.lang.Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata> send(java.lang.String topic, java.lang.Object messageKey, java.lang.Object messagePayload)
public java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata> send(java.lang.String topic, java.lang.Integer partition, java.lang.Object messageKey, java.lang.Object messagePayload)