Class SubscribableRedisChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.redis.channel.SubscribableRedisChannel
- 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.channel.BroadcastCapableChannel
,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
public class SubscribableRedisChannel
extends org.springframework.integration.channel.AbstractMessageChannel
implements org.springframework.integration.channel.BroadcastCapableChannel, org.springframework.integration.support.management.ManageableSmartLifecycle
An
AbstractMessageChannel
implementation with BroadcastCapableChannel
aspect to provide a pub-sub semantics to consume messages fgrom Redis topic.- Since:
- 2.0
-
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.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
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ConstructorsConstructorDescriptionSubscribableRedisChannel
(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, String topicName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
protected boolean
doSend
(org.springframework.messaging.Message<?> message, long arg1) int
getPhase()
boolean
boolean
void
onInit()
void
setMaxSubscribers
(int maxSubscribers) Specify the maximum number of subscribers supported by the channel's dispatcher.void
setMessageConverter
(org.springframework.messaging.converter.MessageConverter messageConverter) void
setSerializer
(org.springframework.data.redis.serializer.RedisSerializer<?> serializer) void
setTaskExecutor
(Executor taskExecutor) void
start()
void
stop()
void
boolean
subscribe
(org.springframework.messaging.MessageHandler handler) boolean
unsubscribe
(org.springframework.messaging.MessageHandler handler) Methods inherited from class org.springframework.integration.channel.AbstractMessageChannel
addInterceptor, addInterceptor, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, removeInterceptor, removeInterceptor, send, send, setDatatypes, setInterceptors, setLoggingEnabled, setObservationConvention, setShouldTrack
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, 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.channel.BroadcastCapableChannel
isBroadcast
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getThisAs, setManagedName, setManagedType
Methods inherited from interface org.springframework.messaging.MessageChannel
send, send
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
SubscribableRedisChannel
public SubscribableRedisChannel(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, String topicName)
-
-
Method Details
-
setTaskExecutor
-
setMessageConverter
public void setMessageConverter(org.springframework.messaging.converter.MessageConverter messageConverter) - Overrides:
setMessageConverter
in classorg.springframework.integration.channel.AbstractMessageChannel
-
setSerializer
public void setSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> serializer) -
setMaxSubscribers
public void setMaxSubscribers(int maxSubscribers) Specify the maximum number of subscribers supported by the channel's dispatcher.- Parameters:
maxSubscribers
- The maximum number of subscribers allowed.
-
subscribe
public boolean subscribe(org.springframework.messaging.MessageHandler handler) - Specified by:
subscribe
in interfaceorg.springframework.messaging.SubscribableChannel
-
unsubscribe
public boolean unsubscribe(org.springframework.messaging.MessageHandler handler) - Specified by:
unsubscribe
in interfaceorg.springframework.messaging.SubscribableChannel
-
doSend
protected boolean doSend(org.springframework.messaging.Message<?> message, long arg1) - Specified by:
doSend
in classorg.springframework.integration.channel.AbstractMessageChannel
-
onInit
public void onInit()- Overrides:
onInit
in classorg.springframework.integration.channel.AbstractMessageChannel
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartup
in interfaceorg.springframework.context.SmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhase
in interfaceorg.springframework.context.Phased
- Specified by:
getPhase
in interfaceorg.springframework.context.SmartLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
- Specified by:
isRunning
in interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
start
public void start()- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
- Specified by:
start
in interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
- Specified by:
stop
in interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
stop
- Specified by:
stop
in interfaceorg.springframework.context.SmartLifecycle
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Specified by:
destroy
in interfaceorg.springframework.integration.support.management.IntegrationManagement
- Overrides:
destroy
in classorg.springframework.integration.channel.AbstractMessageChannel
-