Class SubscribableRedisChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.redis.channel.SubscribableRedisChannel
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Lifecycle,- Phased,- SmartLifecycle,- BroadcastCapableChannel,- ExpressionCapable,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- ManageableLifecycle,- ManageableSmartLifecycle,- TrackableComponent,- MessageChannel,- SubscribableChannel,- InterceptableChannel
public class SubscribableRedisChannel
extends AbstractMessageChannel
implements BroadcastCapableChannel, ManageableSmartLifecycle
An 
AbstractMessageChannel implementation with BroadcastCapableChannel
 aspect to provide a pub-sub semantics to consume messages fgrom Redis topic.- Since:
- 2.0
- Author:
- Oleg Zhurakousky, 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.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_TIMEOUTFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsConstructorDescriptionSubscribableRedisChannel(RedisConnectionFactory connectionFactory, String topicName) 
- 
Method SummaryModifier and TypeMethodDescriptionvoiddestroy()protected booleanSubclasses must implement this method.intgetPhase()booleanbooleanvoidonInit()Subclasses may implement this for initialization logic.voidsetMaxSubscribers(int maxSubscribers) Specify the maximum number of subscribers supported by the channel's dispatcher.voidsetMessageConverter(MessageConverter messageConverter) Specify theMessageConverterto use when trying to convert to one of this channel's supported datatypes (in order) for a Message whose payload does not already match.voidsetSerializer(RedisSerializer<?> serializer) voidsetTaskExecutor(Executor taskExecutor) voidstart()voidstop()voidbooleansubscribe(MessageHandler handler) booleanunsubscribe(MessageHandler handler) Methods inherited from class org.springframework.integration.channel.AbstractMessageChanneladdInterceptor, addInterceptor, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, removeInterceptor, removeInterceptor, send, send, setDatatypes, setInterceptors, setLoggingEnabled, setObservationConvention, setShouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.channel.BroadcastCapableChannelisBroadcastMethods 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- 
SubscribableRedisChannel
 
- 
- 
Method Details- 
setTaskExecutor
- 
setMessageConverterDescription copied from class:AbstractMessageChannelSpecify theMessageConverterto use when trying to convert to one of this channel's supported datatypes (in order) for a Message whose payload does not already match.Note: only the MessageConverter.fromMessage(Message, Class)method is used. If the returned object is not aMessage, the inbound headers will be copied; if the returned object is aMessage, it is expected that the converter will have fully populated the headers; no further action is performed by the channel. Ifnullis returned, conversion to the next datatype (if any) will be attempted. Defaults to aDefaultDatatypeChannelMessageConverter.- Overrides:
- setMessageConverterin class- AbstractMessageChannel
- Parameters:
- messageConverter- The message converter.
 
- 
setSerializer
- 
setMaxSubscriberspublic 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- Specified by:
- subscribein interface- SubscribableChannel
 
- 
unsubscribe- Specified by:
- unsubscribein interface- SubscribableChannel
 
- 
doSendDescription copied from class:AbstractMessageChannelSubclasses must implement this method. A non-negative timeout indicates how long to wait if the channel is at capacity (if the value is 0, it must return immediately with or without success). A negative timeout value indicates that the method should block until either the message is accepted or the blocking thread is interrupted.- Specified by:
- doSendin class- AbstractMessageChannel
- Parameters:
- message- The message.
- arg1- The timeout.
- Returns:
- true if the sendwas successful.
 
- 
onInitpublic void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- AbstractMessageChannel
 
- 
isAutoStartuppublic boolean isAutoStartup()- Specified by:
- isAutoStartupin interface- SmartLifecycle
 
- 
getPhasepublic int getPhase()- Specified by:
- getPhasein interface- Phased
- Specified by:
- getPhasein interface- SmartLifecycle
 
- 
isRunningpublic boolean isRunning()- Specified by:
- isRunningin interface- Lifecycle
- Specified by:
- isRunningin interface- ManageableLifecycle
 
- 
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
 
- 
destroypublic void destroy()- Specified by:
- destroyin interface- DisposableBean
- Specified by:
- destroyin interface- IntegrationManagement
- Overrides:
- destroyin class- AbstractMessageChannel
 
 
-