Spring Integration ConcurrentMetadataStore / RedisMetadataStore -
we have application need poll folder , process files. using clustered environment , on each server files getting processed using multiple threads. using fileinboundadapter, poller , task-executor. seeing same files getting processed in different threads. after reading spring integration documentation seems concurrentmetadatastore/redismetadatastore avoid issue. trying find out sample code redismetadatastore api. can me sample code or suggest different solution?
thanks, mohan
the sample pretty simple. need supply redisconnectionfactory
same redis server cluster nodes , inject filesystempersistentacceptoncefilelistfilter
<int-file:inbound-channel-adapter>
s:
<bean id="redismetadatastore" class="org.springframework.integration.redis.metadata.redismetadatastore"> <constructor-arg ref="redisconnectionfactory"/> </bean> <bean id="acceptoncefilter" class="org.springframework.integration.file.filters.filesystempersistentacceptoncefilelistfilter"> <constructor-arg ref="redismetadatastore"/> <constructor-arg value="the_key"/> </bean> <int-file:inbound-channel-adapter filter="acceptoncefilter"/>
Comments
Post a Comment