public class ReactiveRedisStreamMessageHandler extends AbstractReactiveMessageHandler
ReactiveMessageHandler
which writes
Message payload or Message itself (see extractPayload
) into a Redis stream using Reactive Stream operations.IntegrationManagement.ManagementOverrides
EXPRESSION_PARSER, logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
ReactiveRedisStreamMessageHandler(ReactiveRedisConnectionFactory connectionFactory,
Expression streamKeyExpression)
Create an instance based on provided
ReactiveRedisConnectionFactory and expression for stream key. |
ReactiveRedisStreamMessageHandler(ReactiveRedisConnectionFactory connectionFactory,
String streamKey)
Create an instance based on provided
ReactiveRedisConnectionFactory and key for stream. |
Modifier and Type | Method and Description |
---|---|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected reactor.core.publisher.Mono<Void> |
handleMessageInternal(Message<?> message) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setExtractPayload(boolean extractPayload)
Set to
true to extract the payload; otherwise
the entire message is sent. |
void |
setHashMapper(HashMapper<String,?,?> hashMapper)
(Optional) Set the
HashMapper used to create reactiveStreamOperations . |
void |
setSerializationContext(RedisSerializationContext<String,?> serializationContext) |
handleMessage
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getThisAs
getBeanName, getComponentName
public ReactiveRedisStreamMessageHandler(ReactiveRedisConnectionFactory connectionFactory, String streamKey)
ReactiveRedisConnectionFactory
and key for stream.connectionFactory
- the ReactiveRedisConnectionFactory
to usestreamKey
- the key for streampublic ReactiveRedisStreamMessageHandler(ReactiveRedisConnectionFactory connectionFactory, Expression streamKeyExpression)
ReactiveRedisConnectionFactory
and expression for stream key.connectionFactory
- the ReactiveRedisConnectionFactory
to usestreamKeyExpression
- the SpEL expression to evaluate a key for streampublic void setSerializationContext(RedisSerializationContext<String,?> serializationContext)
public void setHashMapper(@Nullable HashMapper<String,?,?> hashMapper)
HashMapper
used to create reactiveStreamOperations
.
The default HashMapper
is defined from the provided RedisSerializationContext
hashMapper
- the wanted hashMapperpublic void setExtractPayload(boolean extractPayload)
true
to extract the payload; otherwise
the entire message is sent. Default true
.extractPayload
- false to not extract.public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class MessageHandlerSupport
protected void onInit()
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
protected reactor.core.publisher.Mono<Void> handleMessageInternal(Message<?> message)
handleMessageInternal
in class AbstractReactiveMessageHandler