Class RedisQueueOutboundGateway
- All Implemented Interfaces:
org.reactivestreams.Subscriber<org.springframework.messaging.Message<?>>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, 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.core.Ordered, org.springframework.integration.context.ComponentSourceAware, org.springframework.integration.context.ExpressionCapable, org.springframework.integration.context.Orderable, org.springframework.integration.core.MessageProducer, org.springframework.integration.handler.HeaderPropagationAware, 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.MessageHandler, reactor.core.CoreSubscriber<org.springframework.messaging.Message<?>>
- Since:
- 4.1
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler.RequestHandlerNested 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.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, org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllowedPatterns(String... patterns) Add package/class patterns to the allowed list for the defaultAllowListJdkSerializationRedisSerializer.protected @Nullable ObjecthandleRequestMessage(org.springframework.messaging.Message<?> 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(org.springframework.data.redis.serializer.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 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
public RedisQueueOutboundGateway(String queueName, org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware- Overrides:
setBeanClassLoaderin classorg.springframework.integration.handler.AbstractReplyProducingMessageHandler
-
addAllowedPatterns
Add package/class patterns to the allowed list for the defaultAllowListJdkSerializationRedisSerializer. Ignored if a customsetSerializer(RedisSerializer)is provided.- Parameters:
patterns- the patterns to add.- Since:
- 5.5.23
- See Also:
-
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
public void setSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> serializer) -
getComponentType
- Specified by:
getComponentTypein interfaceorg.springframework.integration.support.context.NamedComponent- Overrides:
getComponentTypein classorg.springframework.integration.handler.MessageHandlerSupport
-
handleRequestMessage
- Specified by:
handleRequestMessagein classorg.springframework.integration.handler.AbstractReplyProducingMessageHandler
-
setReceiveTimeout(long)