public class RedisStoreMessageSource extends IntegrationObjectSupport implements MessageSource<RedisStore>
collectionType
attribute.
Default is LIST. This adapter supports 5 types of collections identified by
RedisCollectionFactoryBean.CollectionType
logger
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, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
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 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 keyExpression
receive
in interface MessageSource<RedisStore>
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected void onInit() throws Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
Exception
- Any exception.public RedisStore getResource()
public void afterCommit(Object object)
public void afterRollback(Object object)