Class SubscribableKafkaChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.kafka.channel.AbstractKafkaChannel
org.springframework.integration.kafka.channel.SubscribableKafkaChannel
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Lifecycle,- Phased,- SmartLifecycle,- ComponentSourceAware,- ExpressionCapable,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- ManageableLifecycle,- ManageableSmartLifecycle,- TrackableComponent,- MessageChannel,- SubscribableChannel,- InterceptableChannel
- Direct Known Subclasses:
- PublishSubscribeKafkaChannel
public class SubscribableKafkaChannel
extends AbstractKafkaChannel
implements SubscribableChannel, ManageableSmartLifecycle
Subscribable channel backed by an Apache Kafka topic.
- Since:
- 5.4
- Author:
- Gary Russell, Artem Bilan
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannelAbstractMessageChannel.ChannelInterceptorListNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.kafka.channel.AbstractKafkaChanneltopicFields inherited from class org.springframework.integration.channel.AbstractMessageChannelinterceptors, metersFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.messaging.MessageChannelINDEFINITE_TIMEOUT
- 
Constructor SummaryConstructorsConstructorDescriptionSubscribableKafkaChannel(org.springframework.kafka.core.KafkaOperations<?, ?> template, org.springframework.kafka.config.KafkaListenerContainerFactory<?> factory, String channelTopic) Construct an instance with the provided parameters.
- 
Method SummaryModifier and TypeMethodDescriptionprotected MessageDispatcherintgetPhase()booleanbooleanprotected voidonInit()Subclasses may implement this for initialization logic.voidsetAutoStartup(boolean autoStartup) Set the auto startup.voidsetMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) Set theRecordMessageConverterto the listener.voidsetPhase(int phase) Set the phase.voidstart()voidstop()voidbooleansubscribe(MessageHandler handler) booleanunsubscribe(MessageHandler handler) Methods inherited from class org.springframework.integration.kafka.channel.AbstractKafkaChanneldoSend, getGroupId, setGroupIdMethods inherited from class org.springframework.integration.channel.AbstractMessageChanneladdInterceptor, addInterceptor, destroy, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, removeInterceptor, removeInterceptor, send, send, setDatatypes, setInterceptors, setLoggingEnabled, setMessageConverter, setObservationConvention, setShouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetManagedName, getManagedType, getThisAs, setManagedName, setManagedTypeMethods inherited from interface org.springframework.messaging.MessageChannelsend, sendMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
SubscribableKafkaChannelpublic SubscribableKafkaChannel(org.springframework.kafka.core.KafkaOperations<?, ?> template, org.springframework.kafka.config.KafkaListenerContainerFactory<?> factory, String channelTopic) Construct an instance with the provided parameters.- Parameters:
- template- template for sending.
- factory- factory for creating a container for receiving.
- channelTopic- the topic.
 
 
- 
- 
Method Details- 
setMessageConverterpublic void setMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) Set theRecordMessageConverterto the listener.- Parameters:
- messageConverter- the converter.
- Since:
- 6.0
 
- 
getPhasepublic int getPhase()- Specified by:
- getPhasein interface- Phased
- Specified by:
- getPhasein interface- SmartLifecycle
 
- 
setPhasepublic void setPhase(int phase) Set the phase.- Parameters:
- phase- the phase.
- See Also:
 
- 
isRunningpublic boolean isRunning()- Specified by:
- isRunningin interface- Lifecycle
- Specified by:
- isRunningin interface- ManageableLifecycle
 
- 
setAutoStartuppublic void setAutoStartup(boolean autoStartup) Set the auto startup.- Parameters:
- autoStartup- true to automatically start.
- See Also:
 
- 
isAutoStartuppublic boolean isAutoStartup()- Specified by:
- isAutoStartupin interface- SmartLifecycle
 
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- AbstractMessageChannel
 
- 
createDispatcher
- 
startpublic void start()- Specified by:
- startin interface- Lifecycle
- Specified by:
- startin interface- ManageableLifecycle
 
- 
stoppublic void stop()- Specified by:
- stopin interface- Lifecycle
- Specified by:
- stopin interface- ManageableLifecycle
 
- 
stop- Specified by:
- stopin interface- SmartLifecycle
 
- 
subscribe- Specified by:
- subscribein interface- SubscribableChannel
 
- 
unsubscribe- Specified by:
- unsubscribein interface- SubscribableChannel
 
 
-