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:
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.channel.ExecutorChannelInterceptorAware
,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.PollableChannel
,org.springframework.messaging.support.InterceptableChannel
public class PollableKafkaChannel
extends AbstractKafkaChannel
implements org.springframework.messaging.PollableChannel, org.springframework.integration.channel.ExecutorChannelInterceptorAware
Pollable 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.ChannelInterceptorList
Nested 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
topic
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
ConstructorDescriptionPollableKafkaChannel
(org.springframework.kafka.core.KafkaOperations<?, ?> template, KafkaMessageSource<?, ?> source) Construct an instance with the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInterceptor
(int index, org.springframework.messaging.support.ChannelInterceptor interceptor) void
addInterceptor
(org.springframework.messaging.support.ChannelInterceptor interceptor) protected org.springframework.messaging.Message<?>
boolean
org.springframework.messaging.Message<?>
receive()
org.springframework.messaging.Message<?>
receive
(long timeout) org.springframework.messaging.support.ChannelInterceptor
removeInterceptor
(int index) boolean
removeInterceptor
(org.springframework.messaging.support.ChannelInterceptor interceptor) void
setInterceptors
(List<org.springframework.messaging.support.ChannelInterceptor> interceptors) Methods inherited from class org.springframework.integration.kafka.channel.AbstractKafkaChannel
doSend, getGroupId, setGroupId
Methods inherited from class org.springframework.integration.channel.AbstractMessageChannel
destroy, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, isObserved, onInit, registerMetricsCaptor, registerObservationRegistry, send, send, setDatatypes, 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, getIntegrationProperty, 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.messaging.support.InterceptableChannel
getInterceptors
Methods inherited from interface org.springframework.messaging.MessageChannel
send, send
Methods inherited from interface org.springframework.integration.support.context.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
-
receive
@Nullable public org.springframework.messaging.Message<?> receive()- Specified by:
receive
in interfaceorg.springframework.messaging.PollableChannel
-
receive
@Nullable public org.springframework.messaging.Message<?> receive(long timeout) - Specified by:
receive
in interfaceorg.springframework.messaging.PollableChannel
-
doReceive
@Nullable protected org.springframework.messaging.Message<?> doReceive() -
setInterceptors
public void setInterceptors(List<org.springframework.messaging.support.ChannelInterceptor> interceptors) - Specified by:
setInterceptors
in interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
setInterceptors
in classorg.springframework.integration.channel.AbstractMessageChannel
-
addInterceptor
public void addInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor) - Specified by:
addInterceptor
in interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
addInterceptor
in classorg.springframework.integration.channel.AbstractMessageChannel
-
addInterceptor
public void addInterceptor(int index, org.springframework.messaging.support.ChannelInterceptor interceptor) - Specified by:
addInterceptor
in interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
addInterceptor
in classorg.springframework.integration.channel.AbstractMessageChannel
-
removeInterceptor
public boolean removeInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor) - Specified by:
removeInterceptor
in interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
removeInterceptor
in classorg.springframework.integration.channel.AbstractMessageChannel
-
removeInterceptor
@Nullable public org.springframework.messaging.support.ChannelInterceptor removeInterceptor(int index) - Specified by:
removeInterceptor
in interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
removeInterceptor
in classorg.springframework.integration.channel.AbstractMessageChannel
-
hasExecutorInterceptors
public boolean hasExecutorInterceptors()- Specified by:
hasExecutorInterceptors
in interfaceorg.springframework.integration.channel.ExecutorChannelInterceptorAware
-