public class KafkaProducerMessageHandler
extends org.springframework.integration.handler.AbstractMessageHandler
| Constructor and Description |
|---|
KafkaProducerMessageHandler(KafkaProducerContext kafkaProducerContext) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getComponentType() |
KafkaProducerContext |
getKafkaProducerContext() |
protected void |
handleMessageInternal(org.springframework.messaging.Message<?> message) |
protected void |
onInit() |
void |
setEnableHeaderRouting(boolean enableHeaderRouting)
Enable the use of headers for determining the target topic and partition of outbound messages.
|
void |
setMessageKeyExpression(org.springframework.expression.Expression messageKeyExpression) |
void |
setPartitionExpression(org.springframework.expression.Expression partitionExpression)
Deprecated.
as of 1.3,
setPartitionIdExpression(Expression) should be used instead |
void |
setPartitionIdExpression(org.springframework.expression.Expression partitionIdExpression) |
void |
setTopicExpression(org.springframework.expression.Expression topicExpression) |
getOrder, handleMessage, setOrder, setShouldTrackafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toStringpublic KafkaProducerMessageHandler(KafkaProducerContext kafkaProducerContext)
public void setEnableHeaderRouting(boolean enableHeaderRouting)
enableHeaderRouting - whether the topic and destination headers should be consideredKafkaHeaders.TOPIC,
KafkaHeaders.PARTITION_IDpublic void setTopicExpression(org.springframework.expression.Expression topicExpression)
public void setMessageKeyExpression(org.springframework.expression.Expression messageKeyExpression)
@Deprecated public void setPartitionExpression(org.springframework.expression.Expression partitionExpression)
setPartitionIdExpression(Expression) should be used insteadpartitionExpression - an expression that returns a partition idpublic void setPartitionIdExpression(org.springframework.expression.Expression partitionIdExpression)
public KafkaProducerContext getKafkaProducerContext()
protected void onInit()
throws java.lang.Exception
onInit in class org.springframework.integration.context.IntegrationObjectSupportjava.lang.Exceptionprotected void handleMessageInternal(org.springframework.messaging.Message<?> message)
throws java.lang.Exception
handleMessageInternal in class org.springframework.integration.handler.AbstractMessageHandlerjava.lang.Exceptionpublic java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.handler.AbstractMessageHandler