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:
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.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,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.ManageableLifecycle,org.springframework.integration.support.management.ManageableSmartLifecycle,org.springframework.integration.support.management.TrackableComponent,org.springframework.messaging.MessageChannel,org.springframework.messaging.SubscribableChannel,org.springframework.messaging.support.InterceptableChannel
- Direct Known Subclasses:
PublishSubscribeKafkaChannel
public class SubscribableKafkaChannel
extends AbstractKafkaChannel
implements org.springframework.messaging.SubscribableChannel, org.springframework.integration.support.management.ManageableSmartLifecycle
Subscribable channel 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.ChannelInterceptorListNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.kafka.channel.AbstractKafkaChannel
topicFields 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
ConstructorsConstructorDescriptionSubscribableKafkaChannel(org.springframework.kafka.core.KafkaOperations<?, ?> template, org.springframework.kafka.config.KafkaListenerContainerFactory<?> factory, String channelTopic) Construct an instance with the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.integration.dispatcher.MessageDispatcherintgetPhase()booleanbooleanprotected voidonInit()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(org.springframework.messaging.MessageHandler handler) booleanunsubscribe(org.springframework.messaging.MessageHandler handler) Methods inherited from class org.springframework.integration.kafka.channel.AbstractKafkaChannel
doSend, getGroupId, setGroupIdMethods inherited from class org.springframework.integration.channel.AbstractMessageChannel
addInterceptor, addInterceptor, destroy, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, 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, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, 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.messaging.MessageChannel
send, sendMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
SubscribableKafkaChannel
public 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
-
setMessageConverter
public void setMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) Set theRecordMessageConverterto the listener.- Parameters:
messageConverter- the converter.- Since:
- 6.0
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
setPhase
public void setPhase(int phase) Set the phase.- Parameters:
phase- the phase.- See Also:
-
Phased
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle- Specified by:
isRunningin interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
setAutoStartup
public void setAutoStartup(boolean autoStartup) Set the auto startup.- Parameters:
autoStartup- true to automatically start.- See Also:
-
SmartLifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
onInit
protected void onInit()- Overrides:
onInitin classorg.springframework.integration.channel.AbstractMessageChannel
-
createDispatcher
protected org.springframework.integration.dispatcher.MessageDispatcher createDispatcher() -
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Specified by:
startin interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- Specified by:
stopin interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
stop
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
subscribe
public boolean subscribe(org.springframework.messaging.MessageHandler handler) - Specified by:
subscribein interfaceorg.springframework.messaging.SubscribableChannel
-
unsubscribe
public boolean unsubscribe(org.springframework.messaging.MessageHandler handler) - Specified by:
unsubscribein interfaceorg.springframework.messaging.SubscribableChannel
-