Class KafkaInboundGatewaySpec<K,​V,​R,​S extends KafkaInboundGatewaySpec<K,​V,​R,​S>>

Type Parameters:
K - the key type.
V - the request value type.
R - the reply value type.
S - the target KafkaInboundGatewaySpec implementation type.
All Implemented Interfaces:
Aware, BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<KafkaInboundGateway<K,​V,​R>>, InitializingBean, Lifecycle, Phased, SmartLifecycle, ComponentsRegistration
Direct Known Subclasses:
KafkaInboundGatewaySpec.KafkaInboundGatewayListenerContainerSpec

public class KafkaInboundGatewaySpec<K,​V,​R,​S extends KafkaInboundGatewaySpec<K,​V,​R,​S>>
extends MessagingGatewaySpec<S,​KafkaInboundGateway<K,​V,​R>>
implements ComponentsRegistration
A MessagingGatewaySpec implementation for the KafkaInboundGateway.
Since:
5.4
Author:
Gary Russell, Artem Bilan
  • Method Details

    • messageConverter

      public S messageConverter​(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter)
      Set the message converter to use with a record-based consumer.
      Parameters:
      messageConverter - the converter.
      Returns:
      the spec
    • retryTemplate

      public S retryTemplate​(org.springframework.retry.support.RetryTemplate retryTemplate)
      Specify a RetryTemplate instance to wrap KafkaInboundGateway.IntegrationRecordMessageListener into RetryingMessageListenerAdapter.
      Parameters:
      retryTemplate - the RetryTemplate to use.
      Returns:
      the spec
    • recoveryCallback

      public S recoveryCallback​(org.springframework.retry.RecoveryCallback<?> recoveryCallback)
      A RecoveryCallback instance for retry operation; if null, the exception will be thrown to the container after retries are exhausted. Does not make sense if retryTemplate(RetryTemplate) isn't specified.
      Parameters:
      recoveryCallback - the recovery callback.
      Returns:
      the spec
    • onPartitionsAssignedSeekCallback

      public S onPartitionsAssignedSeekCallback​(BiConsumer<Map<org.apache.kafka.common.TopicPartition,​Long>,​org.springframework.kafka.listener.ConsumerSeekAware.ConsumerSeekCallback> onPartitionsAssignedCallback)
      Specify a BiConsumer for seeks management during ConsumerSeekAware.onPartitionsAssigned(Map, ConsumerSeekAware.ConsumerSeekCallback) call from the KafkaMessageListenerContainer.
      Parameters:
      onPartitionsAssignedCallback - the BiConsumer to use
      Returns:
      the spec
    • getComponentsToRegister

      public Map<Object,​String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface ComponentsRegistration