Class RedisQueueOutboundGateway
- All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>,Aware,BeanClassLoaderAware,BeanFactoryAware,BeanNameAware,DisposableBean,InitializingBean,ApplicationContextAware,Ordered,ComponentSourceAware,ExpressionCapable,Orderable,MessageProducer,HeaderPropagationAware,IntegrationPattern,NamedComponent,IntegrationManagement,TrackableComponent,MessageHandler,reactor.core.CoreSubscriber<Message<?>>
- Since:
- 4.1
- Author:
- David Liu, Artem Bilan, Gary Russell, Glenn Renfro
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
AbstractReplyProducingMessageHandler.RequestHandlerNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
messagingTemplateFields 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.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionRedisQueueOutboundGateway(String queueName, RedisConnectionFactory connectionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable ObjecthandleRequestMessage(Message<?> message) Subclasses must implement this method to handle the request Message.voidsetBeanClassLoader(ClassLoader beanClassLoader) voidsetExtractPayload(boolean extractPayload) voidsetReceiveDuration(Duration receiveTimeout) This timeout is used when retrieving elements from the queue specified byBoundListOperations.voidsetReceiveTimeout(int receiveTimeout) Deprecated, for removal: This API element is subject to removal in a future version.voidsetReceiveTimeout(long receiveTimeout) This timeout is used when retrieving elements from the queue specified byBoundListOperations.voidsetSerializer(RedisSerializer<?> serializer) Methods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
doInit, doInvokeAdvisedRequestHandler, getBeanClassLoader, getIntegrationPatternType, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setRequiresReplyMethods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersMethods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscriber
currentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
RedisQueueOutboundGateway
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceBeanClassLoaderAware- Overrides:
setBeanClassLoaderin classAbstractReplyProducingMessageHandler
-
setReceiveDuration
This timeout is used when retrieving elements from the queue specified byBoundListOperations.If the queue does contain elements, the data is retrieved immediately. However, if the queue is empty, the Redis connection is blocked until either an element can be retrieved from the queue or until the specified timeout passes.
A timeout of zero can be used to block indefinitely. If not set explicitly the timeout value will default to
1000 millisSee also: https://redis.io/commands/brpop
- Parameters:
receiveTimeout-Durationcontaining the receive timeout.- Since:
- 7.1
-
setReceiveTimeout
Deprecated, for removal: This API element is subject to removal in a future version.since 7.1 in favor ofsetReceiveTimeout(long)This timeout is used when retrieving elements from the queue specified byBoundListOperations.If the queue does contain elements, the data is retrieved immediately. However, if the queue is empty, the Redis connection is blocked until either an element can be retrieved from the queue or until the specified timeout passes.
A timeout of zero can be used to block indefinitely. If not set explicitly the timeout value will default to
1000 millisSee also: https://redis.io/commands/brpop
- Parameters:
receiveTimeout- Must be non-negative. Specified in milliseconds.
-
setReceiveTimeout
public void setReceiveTimeout(long receiveTimeout) This timeout is used when retrieving elements from the queue specified byBoundListOperations.If the queue does contain elements, the data is retrieved immediately. However, if the queue is empty, the Redis connection is blocked until either an element can be retrieved from the queue or until the specified timeout passes.
A timeout of zero can be used to block indefinitely. If not set explicitly the timeout value will default to
1000 millisSee also: https://redis.io/commands/brpop
- Parameters:
receiveTimeout- Must be non-negative. Specified in milliseconds.
-
setExtractPayload
public void setExtractPayload(boolean extractPayload) -
setSerializer
-
getComponentType
- Specified by:
getComponentTypein interfaceNamedComponent- Overrides:
getComponentTypein classMessageHandlerSupport
-
handleRequestMessage
Description copied from class:AbstractReplyProducingMessageHandlerSubclasses must implement this method to handle the request Message. The return value may be a Message, a MessageBuilder, or any plain Object. The base class will handle the final creation of a reply Message from any of those starting points. If the return value is null, the Message flow will end here.- Specified by:
handleRequestMessagein classAbstractReplyProducingMessageHandler- Parameters:
message- The request message.- Returns:
- The result of handling the message, or
null.
-
setReceiveTimeout(long)