Class PollableKafkaChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.kafka.channel.AbstractKafkaChannel
org.springframework.integration.kafka.channel.PollableKafkaChannel
- All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, ExecutorChannelInterceptorAware, ComponentSourceAware, ExpressionCapable, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageChannel, PollableChannel, InterceptableChannel
public class PollableKafkaChannel
extends AbstractKafkaChannel
implements PollableChannel, ExecutorChannelInterceptorAware
Pollable channel backed by an Apache Kafka topic.
- Since:
- 5.4
- Author:
- Gary Russell, Artem Bilan, Ngoc Nhan
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMessageChannel
AbstractMessageChannel.ChannelInterceptorListNested classes/interfaces inherited from interface IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class AbstractKafkaChannel
topicFields inherited from class AbstractMessageChannel
interceptors, metersFields inherited from class IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface MessageChannel
INDEFINITE_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionPollableKafkaChannel(org.springframework.kafka.core.KafkaOperations<?, ?> template, KafkaMessageSource<?, ?> source) Construct an instance with the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInterceptor(int index, ChannelInterceptor interceptor) Add a channel interceptor to the specified index of the list.voidaddInterceptor(ChannelInterceptor interceptor) Add a channel interceptor to the end of the list.protected @Nullable Message<?> booleanprotected voidonInit()Subclasses may implement this for initialization logic.@Nullable Message<?> receive()@Nullable Message<?> receive(long timeout) removeInterceptor(int index) booleanremoveInterceptor(ChannelInterceptor interceptor) voidsetInterceptors(List<ChannelInterceptor> interceptors) Set the list of channel interceptors.Methods inherited from class AbstractKafkaChannel
doSend, getGroupId, setGroupIdMethods inherited from class AbstractMessageChannel
destroy, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, isApplicationRunning, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, send, send, setDatatypes, setLoggingEnabled, setMessageConverter, setObservationConvention, setShouldTrackMethods inherited from class 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IntegrationManagement
getManagedName, getManagedType, getThisAs, setManagedName, setManagedTypeMethods inherited from interface InterceptableChannel
getInterceptorsMethods inherited from interface MessageChannel
send, sendMethods inherited from interface NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
PollableKafkaChannel
public PollableKafkaChannel(org.springframework.kafka.core.KafkaOperations<?, ?> template, KafkaMessageSource<?, ?> source) Construct an instance with the provided parameters.- Parameters:
template- the template for sending.source- the source for receiving.
-
-
Method Details
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
onInitin classAbstractMessageChannel
-
receive
- Specified by:
receivein interfacePollableChannel
-
receive
- Specified by:
receivein interfacePollableChannel
-
doReceive
-
setInterceptors
Description copied from class:AbstractMessageChannelSet the list of channel interceptors. This will clear any existing interceptors.- Specified by:
setInterceptorsin interfaceInterceptableChannel- Overrides:
setInterceptorsin classAbstractMessageChannel- Parameters:
interceptors- The list of interceptors.
-
addInterceptor
Description copied from class:AbstractMessageChannelAdd a channel interceptor to the end of the list.- Specified by:
addInterceptorin interfaceInterceptableChannel- Overrides:
addInterceptorin classAbstractMessageChannel- Parameters:
interceptor- The interceptor.
-
addInterceptor
Description copied from class:AbstractMessageChannelAdd a channel interceptor to the specified index of the list.- Specified by:
addInterceptorin interfaceInterceptableChannel- Overrides:
addInterceptorin classAbstractMessageChannel- Parameters:
index- The index to add interceptor.interceptor- The interceptor.
-
removeInterceptor
- Specified by:
removeInterceptorin interfaceInterceptableChannel- Overrides:
removeInterceptorin classAbstractMessageChannel
-
removeInterceptor
- Specified by:
removeInterceptorin interfaceInterceptableChannel- Overrides:
removeInterceptorin classAbstractMessageChannel
-
hasExecutorInterceptors
public boolean hasExecutorInterceptors()- Specified by:
hasExecutorInterceptorsin interfaceExecutorChannelInterceptorAware
-