public class KafkaMessageChannelBinder extends org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,Collection<org.apache.kafka.common.PartitionInfo>,String> implements org.springframework.cloud.stream.binder.ExtendedPropertiesBinder<org.springframework.messaging.MessageChannel,KafkaConsumerProperties,KafkaProducerProperties>, org.springframework.beans.factory.DisposableBean
Binder
that uses Kafka as the underlying middleware.Constructor and Description |
---|
KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties) |
Modifier and Type | Method and Description |
---|---|
protected Collection<org.apache.kafka.common.PartitionInfo> |
createConsumerDestinationIfNecessary(String name,
String group,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> properties) |
protected org.springframework.integration.core.MessageProducer |
createConsumerEndpoint(String name,
String group,
Collection<org.apache.kafka.common.PartitionInfo> destination,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> properties) |
protected String |
createProducerDestinationIfNecessary(String name,
org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> properties) |
protected org.springframework.messaging.MessageHandler |
createProducerMessageHandler(String destination,
org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties) |
void |
destroy() |
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.kafka.support.ProducerListener<byte[],byte[]> producerListener) |
afterUnbindConsumer, afterUnbindProducer, doBindConsumer, doBindProducer
afterPropertiesSet, applyPrefix, bindConsumer, bindProducer, buildPartitionRoutingExpression, buildRetryTemplate, constructDLQName, getApplicationContext, getBeanFactory, groupedName, setApplicationContext, setCodec, setIntegrationEvaluationContext
public KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties)
public void setMetadataRetryOperations(org.springframework.retry.RetryOperations metadataRetryOperations)
metadataRetryOperations
- the retry configurationpublic void setExtendedBindingProperties(KafkaExtendedBindingProperties extendedBindingProperties)
public void onInit() throws Exception
onInit
in class org.springframework.cloud.stream.binder.AbstractBinder<org.springframework.messaging.MessageChannel,org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>>
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
public void setProducerListener(org.springframework.kafka.support.ProducerListener<byte[],byte[]> producerListener)
public KafkaConsumerProperties getExtendedConsumerProperties(String channelName)
getExtendedConsumerProperties
in interface org.springframework.cloud.stream.binder.ExtendedBindingProperties<KafkaConsumerProperties,KafkaProducerProperties>
public KafkaProducerProperties getExtendedProducerProperties(String channelName)
getExtendedProducerProperties
in interface org.springframework.cloud.stream.binder.ExtendedBindingProperties<KafkaConsumerProperties,KafkaProducerProperties>
protected org.springframework.messaging.MessageHandler createProducerMessageHandler(String destination, org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties) throws Exception
createProducerMessageHandler
in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,Collection<org.apache.kafka.common.PartitionInfo>,String>
Exception
protected String createProducerDestinationIfNecessary(String name, org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> properties)
createProducerDestinationIfNecessary
in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,Collection<org.apache.kafka.common.PartitionInfo>,String>
protected Collection<org.apache.kafka.common.PartitionInfo> createConsumerDestinationIfNecessary(String name, String group, org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> properties)
createConsumerDestinationIfNecessary
in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,Collection<org.apache.kafka.common.PartitionInfo>,String>
protected org.springframework.integration.core.MessageProducer createConsumerEndpoint(String name, String group, Collection<org.apache.kafka.common.PartitionInfo> destination, org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> properties)
createConsumerEndpoint
in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,Collection<org.apache.kafka.common.PartitionInfo>,String>
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.