public class RedisStoreMessageSource extends AbstractMessageSource<RedisStore>
collectionType
attribute.
Default is LIST. This adapter supports 5 types of collections identified by
RedisCollectionFactoryBean.CollectionType
IntegrationManagement.ManagementOverrides
EXPRESSION_PARSER, logger
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
RedisStoreMessageSource(RedisConnectionFactory connectionFactory,
Expression keyExpression)
Creates an instance with the provided
RedisConnectionFactory and SpEL expression
which should resolve to a 'key' name of the collection to be used. |
RedisStoreMessageSource(RedisTemplate<String,?> redisTemplate,
Expression keyExpression)
Creates an instance with the provided
RedisTemplate and SpEL expression
which should resolve to a 'key' name of the collection to be used. |
Modifier and Type | Method and Description |
---|---|
void |
afterCommit(Object object) |
void |
afterRollback(Object object) |
protected RedisStore |
doReceive()
Returns a Message with the view into a
RedisStore identified
by keyExpression |
String |
getComponentType() |
RedisStore |
getResource() |
protected void |
onInit() |
void |
setCollectionType(RedisCollectionFactoryBean.CollectionType collectionType) |
buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedType
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionService
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIntegrationPatternType
getThisAs
public RedisStoreMessageSource(RedisTemplate<String,?> redisTemplate, Expression keyExpression)
RedisTemplate
and SpEL expression
which should resolve to a 'key' name of the collection to be used.
It assumes that RedisTemplate
is fully initialized and ready to be used.
The 'keyExpression' will be evaluated on every call to the AbstractMessageSource.receive()
method.redisTemplate
- The Redis template.keyExpression
- The key expression.public RedisStoreMessageSource(RedisConnectionFactory connectionFactory, Expression keyExpression)
RedisConnectionFactory
and SpEL expression
which should resolve to a 'key' name of the collection to be used.
It will create and initialize an instance of StringRedisTemplate
that uses
StringRedisSerializer
for all
serialization.
The 'keyExpression' will be evaluated on every call to the AbstractMessageSource.receive()
method.connectionFactory
- The connection factory.keyExpression
- The key expression.public void setCollectionType(RedisCollectionFactoryBean.CollectionType collectionType)
protected void onInit()
onInit
in class AbstractExpressionEvaluator
protected RedisStore doReceive()
RedisStore
identified
by keyExpression
doReceive
in class AbstractMessageSource<RedisStore>
public String getComponentType()
public RedisStore getResource()
public void afterCommit(Object object)
public void afterRollback(Object object)