Class AbstractKafkaChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.kafka.channel.AbstractKafkaChannel
- All Implemented Interfaces:
Aware,BeanFactoryAware,BeanNameAware,DisposableBean,InitializingBean,ApplicationContextAware,ComponentSourceAware,ExpressionCapable,IntegrationPattern,NamedComponent,IntegrationManagement,TrackableComponent,MessageChannel,InterceptableChannel
- Direct Known Subclasses:
PollableKafkaChannel,SubscribableKafkaChannel
Abstract MessageChannel backed by an Apache Kafka topic.
- Since:
- 5.4
- Author:
- Gary Russell, Artem Bilan
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannel
AbstractMessageChannel.ChannelInterceptorListNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
FieldsFields inherited from class org.springframework.integration.channel.AbstractMessageChannel
interceptors, metersFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.messaging.MessageChannel
INDEFINITE_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionAbstractKafkaChannel(org.springframework.kafka.core.KafkaOperations<?, ?> template, String topic) Construct an instance with the providedKafkaOperationsand topic. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanSubclasses must implement this method.protected @Nullable StringvoidsetGroupId(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, isApplicationRunning, isLoggingEnabled, isObserved, onInit, registerMetricsCaptor, registerObservationRegistry, removeInterceptor, removeInterceptor, send, send, setDatatypes, setInterceptors, setLoggingEnabled, setMessageConverter, setObservationConvention, setShouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getThisAs, setManagedName, setManagedTypeMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Field Details
-
topic
-
-
Constructor Details
-
AbstractKafkaChannel
public AbstractKafkaChannel(org.springframework.kafka.core.KafkaOperations<?, ?> template, String topic) Construct an instance with the providedKafkaOperationsand topic.- Parameters:
template- the template.topic- the topic.
-
-
Method Details
-
setGroupId
Set the group id for the consumer; if not set, the bean name will be used.- Parameters:
groupId- the group id.
-
getGroupId
-
doSend
Description copied from class:AbstractMessageChannelSubclasses must implement this method. A non-negative timeout indicates how long to wait if the channel is at capacity (if the value is 0, it must return immediately with or without success). A negative timeout value indicates that the method should block until either the message is accepted or the blocking thread is interrupted.- Specified by:
doSendin classAbstractMessageChannel- Parameters:
message- The message.timeout- The timeout.- Returns:
- true if the
sendwas successful.
-