public class KafkaMessageChannelBinder extends org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,KafkaTopicProvisioner> implements org.springframework.cloud.stream.binder.ExtendedPropertiesBinder<org.springframework.messaging.MessageChannel,KafkaConsumerProperties,KafkaProducerProperties>
Binder that uses Kafka as the
underlying middleware.| Modifier and Type | Field and Description |
|---|---|
static String |
X_EXCEPTION_FQCN
Kafka header for x-exception-fqcn.
|
static String |
X_EXCEPTION_MESSAGE
Kafka header for x-exception-message.
|
static String |
X_EXCEPTION_STACKTRACE
Kafka header for x-exception-stacktrace.
|
static String |
X_ORIGINAL_OFFSET
Kafka header for x-original-offset.
|
static String |
X_ORIGINAL_PARTITION
Kafka header for x-original-partition.
|
static String |
X_ORIGINAL_TIMESTAMP
Kafka header for x-original-timestamp.
|
static String |
X_ORIGINAL_TIMESTAMP_TYPE
Kafka header for x-original-timestamp-type.
|
static String |
X_ORIGINAL_TOPIC
Kafka header for x-original-topic.
|
| Constructor and Description |
|---|
KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties,
KafkaTopicProvisioner provisioningProvider) |
KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties,
KafkaTopicProvisioner provisioningProvider,
org.springframework.cloud.stream.config.ListenerContainerCustomizer<org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?>> containerCustomizer,
KafkaBindingRebalanceListener rebalanceListener) |
KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties,
KafkaTopicProvisioner provisioningProvider,
org.springframework.cloud.stream.config.ListenerContainerCustomizer<org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?>> containerCustomizer,
org.springframework.cloud.stream.config.MessageSourceCustomizer<org.springframework.integration.kafka.inbound.KafkaMessageSource<?,?>> sourceCustomizer,
KafkaBindingRebalanceListener rebalanceListener,
DlqPartitionFunction dlqPartitionFunction,
DlqDestinationResolver dlqDestinationResolver) |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.integration.core.MessageProducer |
createConsumerEndpoint(org.springframework.cloud.stream.provisioning.ConsumerDestination destination,
String group,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> extendedConsumerProperties) |
protected org.springframework.kafka.core.ConsumerFactory<?,?> |
createKafkaConsumerFactory(boolean anonymous,
String consumerGroup,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> consumerProperties,
String beanName,
String destination) |
protected org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.PolledConsumerResources |
createPolledConsumerResources(String name,
String group,
org.springframework.cloud.stream.provisioning.ConsumerDestination destination,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> extendedConsumerProperties) |
protected org.springframework.messaging.MessageHandler |
createProducerMessageHandler(org.springframework.cloud.stream.provisioning.ProducerDestination destination,
org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties,
org.springframework.messaging.MessageChannel errorChannel) |
protected org.springframework.messaging.MessageHandler |
createProducerMessageHandler(org.springframework.cloud.stream.provisioning.ProducerDestination destination,
org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties,
org.springframework.messaging.MessageChannel channel,
org.springframework.messaging.MessageChannel errorChannel) |
String |
getDefaultsPrefix() |
protected org.springframework.messaging.MessageHandler |
getErrorMessageHandler(org.springframework.cloud.stream.provisioning.ConsumerDestination destination,
String group,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> properties) |
protected org.springframework.integration.support.ErrorMessageStrategy |
getErrorMessageStrategy() |
KafkaConsumerProperties |
getExtendedConsumerProperties(String channelName) |
KafkaProducerProperties |
getExtendedProducerProperties(String channelName) |
Class<? extends org.springframework.cloud.stream.binder.BinderSpecificPropertiesProvider> |
getExtendedPropertiesEntryClass() |
protected org.springframework.messaging.MessageHandler |
getPolledConsumerErrorMessageHandler(org.springframework.cloud.stream.provisioning.ConsumerDestination destination,
String group,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> properties) |
protected org.springframework.kafka.core.DefaultKafkaProducerFactory<byte[],byte[]> |
getProducerFactory(String transactionIdPrefix,
org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties,
String beanName,
String destination) |
org.springframework.kafka.core.ProducerFactory<byte[],byte[]> |
getTransactionalProducerFactory()
Return a reference to the binder's transaction manager's producer factory (if
configured).
|
protected void |
postProcessOutputChannel(org.springframework.messaging.MessageChannel outputChannel,
org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties) |
protected void |
postProcessPollableSource(org.springframework.cloud.stream.binder.DefaultPollableMessageSource bindingTarget) |
Collection<org.apache.kafka.common.PartitionInfo> |
processTopic(String group,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> extendedConsumerProperties,
org.springframework.kafka.core.ConsumerFactory<?,?> consumerFactory,
int partitionCount,
boolean usingPatterns,
boolean groupManagement,
String topic) |
void |
setClientFactoryCustomizer(ClientFactoryCustomizer customizer) |
void |
setConsumerConfigCustomizer(ConsumerConfigCustomizer consumerConfigCustomizer) |
void |
setDlqDestinationResolver(DlqDestinationResolver dlqDestinationResolver) |
void |
setDlqPartitionFunction(DlqPartitionFunction dlqPartitionFunction) |
void |
setExtendedBindingProperties(KafkaExtendedBindingProperties extendedBindingProperties) |
void |
setProducerConfigCustomizer(ProducerConfigCustomizer producerConfigCustomizer) |
void |
setProducerListener(org.springframework.kafka.support.ProducerListener<byte[],byte[]> producerListener) |
void |
setRebalanceListener(KafkaBindingRebalanceListener rebalanceListener) |
void |
setupRebalanceListener(org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> extendedConsumerProperties,
org.springframework.kafka.listener.ContainerProperties containerProperties) |
protected boolean |
useNativeEncoding(org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties) |
afterUnbindConsumer, afterUnbindProducer, bindPollableConsumer, doBindConsumer, doBindProducer, errorsBaseName, errorsBaseName, getApplicationEventPublisher, getContainerCustomizer, getDefaultErrorMessageHandler, getErrorBridgeName, getErrorBridgeName, getErrorMessageHandlerName, getErrorRecovererName, getMessageSourceCustomizer, getPolledConsumerRecoveryCallback, registerErrorInfrastructure, registerErrorInfrastructure, setApplicationEventPublisher, setConsumerEndpointCustomizer, setProducerMessageHandlerCustomizerafterPropertiesSet, applyPrefix, bindConsumer, bindProducer, buildRetryTemplate, constructDLQName, getApplicationContext, getBeanFactory, getEvaluationContext, groupedName, onInit, setApplicationContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final String X_EXCEPTION_FQCN
public static final String X_EXCEPTION_STACKTRACE
public static final String X_EXCEPTION_MESSAGE
public static final String X_ORIGINAL_TOPIC
public static final String X_ORIGINAL_PARTITION
public static final String X_ORIGINAL_OFFSET
public static final String X_ORIGINAL_TIMESTAMP
public static final String X_ORIGINAL_TIMESTAMP_TYPE
public KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties, KafkaTopicProvisioner provisioningProvider)
public KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties, KafkaTopicProvisioner provisioningProvider, org.springframework.cloud.stream.config.ListenerContainerCustomizer<org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?>> containerCustomizer, KafkaBindingRebalanceListener rebalanceListener)
public KafkaMessageChannelBinder(KafkaBinderConfigurationProperties configurationProperties, KafkaTopicProvisioner provisioningProvider, org.springframework.cloud.stream.config.ListenerContainerCustomizer<org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?>> containerCustomizer, org.springframework.cloud.stream.config.MessageSourceCustomizer<org.springframework.integration.kafka.inbound.KafkaMessageSource<?,?>> sourceCustomizer, KafkaBindingRebalanceListener rebalanceListener, DlqPartitionFunction dlqPartitionFunction, DlqDestinationResolver dlqDestinationResolver)
public void setExtendedBindingProperties(KafkaExtendedBindingProperties extendedBindingProperties)
public void setProducerListener(org.springframework.kafka.support.ProducerListener<byte[],byte[]> producerListener)
public void setClientFactoryCustomizer(ClientFactoryCustomizer customizer)
public void setRebalanceListener(KafkaBindingRebalanceListener rebalanceListener)
public void setDlqPartitionFunction(DlqPartitionFunction dlqPartitionFunction)
public void setDlqDestinationResolver(DlqDestinationResolver dlqDestinationResolver)
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>public String getDefaultsPrefix()
getDefaultsPrefix in interface org.springframework.cloud.stream.binder.ExtendedBindingProperties<KafkaConsumerProperties,KafkaProducerProperties>public Class<? extends org.springframework.cloud.stream.binder.BinderSpecificPropertiesProvider> getExtendedPropertiesEntryClass()
getExtendedPropertiesEntryClass in interface org.springframework.cloud.stream.binder.ExtendedBindingProperties<KafkaConsumerProperties,KafkaProducerProperties>@Nullable public org.springframework.kafka.core.ProducerFactory<byte[],byte[]> getTransactionalProducerFactory()
protected org.springframework.messaging.MessageHandler createProducerMessageHandler(org.springframework.cloud.stream.provisioning.ProducerDestination destination,
org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties,
org.springframework.messaging.MessageChannel errorChannel)
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>,KafkaTopicProvisioner>Exceptionprotected org.springframework.messaging.MessageHandler createProducerMessageHandler(org.springframework.cloud.stream.provisioning.ProducerDestination destination,
org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties,
org.springframework.messaging.MessageChannel channel,
org.springframework.messaging.MessageChannel errorChannel)
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>,KafkaTopicProvisioner>Exceptionprotected void postProcessOutputChannel(org.springframework.messaging.MessageChannel outputChannel,
org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties)
postProcessOutputChannel in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,KafkaTopicProvisioner>protected org.springframework.kafka.core.DefaultKafkaProducerFactory<byte[],byte[]> getProducerFactory(String transactionIdPrefix, org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties, String beanName, String destination)
protected boolean useNativeEncoding(org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties> producerProperties)
useNativeEncoding in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,KafkaTopicProvisioner>protected org.springframework.integration.core.MessageProducer createConsumerEndpoint(org.springframework.cloud.stream.provisioning.ConsumerDestination destination,
String group,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> extendedConsumerProperties)
createConsumerEndpoint in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,KafkaTopicProvisioner>public void setupRebalanceListener(org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> extendedConsumerProperties, org.springframework.kafka.listener.ContainerProperties containerProperties)
public Collection<org.apache.kafka.common.PartitionInfo> processTopic(String group, org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> extendedConsumerProperties, org.springframework.kafka.core.ConsumerFactory<?,?> consumerFactory, int partitionCount, boolean usingPatterns, boolean groupManagement, String topic)
protected org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.PolledConsumerResources createPolledConsumerResources(String name, String group, org.springframework.cloud.stream.provisioning.ConsumerDestination destination, org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> extendedConsumerProperties)
createPolledConsumerResources in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,KafkaTopicProvisioner>protected void postProcessPollableSource(org.springframework.cloud.stream.binder.DefaultPollableMessageSource bindingTarget)
postProcessPollableSource in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,KafkaTopicProvisioner>protected org.springframework.integration.support.ErrorMessageStrategy getErrorMessageStrategy()
getErrorMessageStrategy in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,KafkaTopicProvisioner>protected org.springframework.messaging.MessageHandler getErrorMessageHandler(org.springframework.cloud.stream.provisioning.ConsumerDestination destination,
String group,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> properties)
getErrorMessageHandler in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,KafkaTopicProvisioner>protected org.springframework.messaging.MessageHandler getPolledConsumerErrorMessageHandler(org.springframework.cloud.stream.provisioning.ConsumerDestination destination,
String group,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> properties)
getPolledConsumerErrorMessageHandler in class org.springframework.cloud.stream.binder.AbstractMessageChannelBinder<org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties>,org.springframework.cloud.stream.binder.ExtendedProducerProperties<KafkaProducerProperties>,KafkaTopicProvisioner>protected org.springframework.kafka.core.ConsumerFactory<?,?> createKafkaConsumerFactory(boolean anonymous,
String consumerGroup,
org.springframework.cloud.stream.binder.ExtendedConsumerProperties<KafkaConsumerProperties> consumerProperties,
String beanName,
String destination)
public void setConsumerConfigCustomizer(ConsumerConfigCustomizer consumerConfigCustomizer)
public void setProducerConfigCustomizer(ProducerConfigCustomizer producerConfigCustomizer)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.