public class RedisStoreMessageSource extends IntegrationObjectSupport implements MessageSource<RedisStore>
collectionType attribute.
Default is LIST. This adapter supports 5 types of collections identified by
RedisCollectionFactoryBean.CollectionTypelogger| 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) |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
RedisStore |
getResource() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
Message<RedisStore> |
receive()
Returns a Message with the view into a
RedisStore identified
by keyExpression |
void |
setCollectionType(RedisCollectionFactoryBean.CollectionType collectionType) |
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toStringpublic 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 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 receive() method.connectionFactory - The connection factory.keyExpression - The key expression.public void setCollectionType(RedisCollectionFactoryBean.CollectionType collectionType)
public Message<RedisStore> receive()
RedisStore identified
by keyExpressionreceive in interface MessageSource<RedisStore>public String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class IntegrationObjectSupportprotected void onInit()
throws Exception
IntegrationObjectSupportonInit in class IntegrationObjectSupportException - Any exception.public RedisStore getResource()
public void afterCommit(Object object)
public void afterRollback(Object object)