Class AbstractKafkaChannel

java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.kafka.channel.AbstractKafkaChannel
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.integration.context.ExpressionCapable, org.springframework.integration.IntegrationPattern, org.springframework.integration.support.context.NamedComponent, org.springframework.integration.support.management.IntegrationManagement, org.springframework.integration.support.management.TrackableComponent, org.springframework.messaging.MessageChannel, org.springframework.messaging.support.InterceptableChannel
Direct Known Subclasses:
PollableKafkaChannel, SubscribableKafkaChannel

public abstract class AbstractKafkaChannel extends org.springframework.integration.channel.AbstractMessageChannel
Abstract MessageChannel backed by an Apache Kafka topic.
Since:
5.4
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannel

    org.springframework.integration.channel.AbstractMessageChannel.ChannelInterceptorList

    Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement

    org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
     

    Fields inherited from class org.springframework.integration.channel.AbstractMessageChannel

    interceptors, meters

    Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport

    EXPRESSION_PARSER, logger

    Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement

    METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME

    Fields inherited from interface org.springframework.messaging.MessageChannel

    INDEFINITE_TIMEOUT
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractKafkaChannel(org.springframework.kafka.core.KafkaOperations<?,?> template, String topic)
    Construct an instance with the provided KafkaOperations and topic.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    doSend(org.springframework.messaging.Message<?> message, long timeout)
     
    protected String
     
    void
    setGroupId(String groupId)
    Set the group id for the consumer; if not set, the bean name will be used.

    Methods inherited from class org.springframework.integration.channel.AbstractMessageChannel

    addInterceptor, addInterceptor, destroy, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, isObserved, onInit, registerMetricsCaptor, registerObservationRegistry, removeInterceptor, removeInterceptor, send, send, setDatatypes, setInterceptors, setLoggingEnabled, setMessageConverter, setObservationConvention, setShouldTrack

    Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport

    afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement

    getManagedName, getManagedType, getThisAs, setManagedName, setManagedType

    Methods inherited from interface org.springframework.integration.support.context.NamedComponent

    getBeanName, getComponentName
  • Field Details

    • topic

      protected final String topic
  • Constructor Details

    • AbstractKafkaChannel

      public AbstractKafkaChannel(org.springframework.kafka.core.KafkaOperations<?,?> template, String topic)
      Construct an instance with the provided KafkaOperations and topic.
      Parameters:
      template - the template.
      topic - the topic.
  • Method Details

    • setGroupId

      public void setGroupId(String groupId)
      Set the group id for the consumer; if not set, the bean name will be used.
      Parameters:
      groupId - the group id.
    • getGroupId

      protected String getGroupId()
    • doSend

      protected boolean doSend(org.springframework.messaging.Message<?> message, long timeout)
      Specified by:
      doSend in class org.springframework.integration.channel.AbstractMessageChannel