public class KafkaMessageChannelBinder extends AbstractBinder<org.springframework.messaging.MessageChannel,ExtendedConsumerProperties<KafkaConsumerProperties>,ExtendedProducerProperties<KafkaProducerProperties>> implements ExtendedPropertiesBinder<org.springframework.messaging.MessageChannel,KafkaConsumerProperties,KafkaProducerProperties>, org.springframework.beans.factory.DisposableBean
Binder
that uses Kafka as the underlying middleware.Modifier and Type | Class and Description |
---|---|
static class |
KafkaMessageChannelBinder.StartOffset |
AbstractBinder.JavaClassMimeTypeConversion
Modifier and Type | Field and Description |
---|---|
static org.apache.kafka.common.serialization.ByteArraySerializer |
BYTE_ARRAY_SERIALIZER |
static ThreadFactory |
DAEMON_THREAD_FACTORY |
embeddedHeadersMessageConverter, evaluationContext, logger, PARTITION_HEADER, partitionSelector
Constructor and Description |
---|
KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties) |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
protected Binding<org.springframework.messaging.MessageChannel> |
doBindConsumer(String name,
String group,
org.springframework.messaging.MessageChannel inputChannel,
ExtendedConsumerProperties<KafkaConsumerProperties> properties) |
Binding<org.springframework.messaging.MessageChannel> |
doBindProducer(String name,
org.springframework.messaging.MessageChannel moduleOutputChannel,
ExtendedProducerProperties<KafkaProducerProperties> properties) |
void |
doManualAck(LinkedList<org.springframework.messaging.MessageHeaders> messageHeadersList) |
org.springframework.integration.kafka.core.ConnectionFactory |
getConnectionFactory() |
KafkaConsumerProperties |
getExtendedConsumerProperties(String channelName) |
KafkaProducerProperties |
getExtendedProducerProperties(String channelName) |
void |
onInit() |
void |
setExtendedBindingProperties(KafkaExtendedBindingProperties extendedBindingProperties) |
void |
setMetadataRetryOperations(org.springframework.retry.RetryOperations metadataRetryOperations)
Retry configuration for operations such as validating topic creation
|
void |
setProducerListener(org.springframework.integration.kafka.support.ProducerListener producerListener) |
static void |
validateTopicName(String topicName)
Allowed chars are ASCII alphanumerics, '.', '_' and '-'.
|
afterPropertiesSet, applyPrefix, bindConsumer, bindProducer, buildPartitionRoutingExpression, buildRetryTemplateIfRetryEnabled, constructDLQName, deserializePayloadIfNecessary, deserializePayloadIfNecessary, extractMessageValues, getApplicationContext, getBeanFactory, groupedName, serializePayloadIfNecessary, setApplicationContext, setCodec, setIntegrationEvaluationContext, setPartitionSelector
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bindConsumer, bindProducer
public static final org.apache.kafka.common.serialization.ByteArraySerializer BYTE_ARRAY_SERIALIZER
public static final ThreadFactory DAEMON_THREAD_FACTORY
public KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties)
public org.springframework.integration.kafka.core.ConnectionFactory getConnectionFactory()
public void setProducerListener(org.springframework.integration.kafka.support.ProducerListener producerListener)
public void setMetadataRetryOperations(org.springframework.retry.RetryOperations metadataRetryOperations)
metadataRetryOperations
- the retry configurationpublic void setExtendedBindingProperties(KafkaExtendedBindingProperties extendedBindingProperties)
public void onInit() throws Exception
onInit
in class AbstractBinder<org.springframework.messaging.MessageChannel,ExtendedConsumerProperties<KafkaConsumerProperties>,ExtendedProducerProperties<KafkaProducerProperties>>
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
public static void validateTopicName(String topicName)
public KafkaConsumerProperties getExtendedConsumerProperties(String channelName)
getExtendedConsumerProperties
in interface ExtendedBindingProperties<KafkaConsumerProperties,KafkaProducerProperties>
public KafkaProducerProperties getExtendedProducerProperties(String channelName)
getExtendedProducerProperties
in interface ExtendedBindingProperties<KafkaConsumerProperties,KafkaProducerProperties>
protected Binding<org.springframework.messaging.MessageChannel> doBindConsumer(String name, String group, org.springframework.messaging.MessageChannel inputChannel, ExtendedConsumerProperties<KafkaConsumerProperties> properties)
doBindConsumer
in class AbstractBinder<org.springframework.messaging.MessageChannel,ExtendedConsumerProperties<KafkaConsumerProperties>,ExtendedProducerProperties<KafkaProducerProperties>>
public Binding<org.springframework.messaging.MessageChannel> doBindProducer(String name, org.springframework.messaging.MessageChannel moduleOutputChannel, ExtendedProducerProperties<KafkaProducerProperties> properties)
doBindProducer
in class AbstractBinder<org.springframework.messaging.MessageChannel,ExtendedConsumerProperties<KafkaConsumerProperties>,ExtendedProducerProperties<KafkaProducerProperties>>
public void doManualAck(LinkedList<org.springframework.messaging.MessageHeaders> messageHeadersList)
doManualAck
in class AbstractBinder<org.springframework.messaging.MessageChannel,ExtendedConsumerProperties<KafkaConsumerProperties>,ExtendedProducerProperties<KafkaProducerProperties>>
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.