public class RedisStoreMessageSource
extends org.springframework.integration.context.IntegrationObjectSupport
implements org.springframework.integration.core.MessageSource<org.springframework.data.redis.support.collections.RedisStore>
collectionType attribute.
Default is LIST. This adapter supports 5 types of collections identified by
RedisCollectionFactoryBean.CollectionType| Constructor and Description |
|---|
RedisStoreMessageSource(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
org.springframework.expression.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(org.springframework.data.redis.core.RedisTemplate<java.lang.String,?> redisTemplate,
org.springframework.expression.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(java.lang.Object object) |
void |
afterRollback(java.lang.Object object) |
java.lang.String |
getComponentType() |
org.springframework.data.redis.support.collections.RedisStore |
getResource() |
protected void |
onInit() |
org.springframework.messaging.Message<org.springframework.data.redis.support.collections.RedisStore> |
receive()
Returns a Message with the view into a
RedisStore identified
by keyExpression |
void |
setCollectionType(org.springframework.data.redis.support.collections.RedisCollectionFactoryBean.CollectionType collectionType) |
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringpublic RedisStoreMessageSource(org.springframework.data.redis.core.RedisTemplate<java.lang.String,?> redisTemplate,
org.springframework.expression.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(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
org.springframework.expression.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(org.springframework.data.redis.support.collections.RedisCollectionFactoryBean.CollectionType collectionType)
public org.springframework.messaging.Message<org.springframework.data.redis.support.collections.RedisStore> receive()
RedisStore identified
by keyExpressionreceive in interface org.springframework.integration.core.MessageSource<org.springframework.data.redis.support.collections.RedisStore>public java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.context.IntegrationObjectSupportprotected void onInit()
throws java.lang.Exception
onInit in class org.springframework.integration.context.IntegrationObjectSupportjava.lang.Exceptionpublic org.springframework.data.redis.support.collections.RedisStore getResource()
public void afterCommit(java.lang.Object object)
public void afterRollback(java.lang.Object object)