Apache Camel RedisIdempotentRepository配置 [英] Apache Camel RedisIdempotentRepository Configuration
问题描述
有人能成功地在骆驼路线上使RedisIdempotentRepository工作吗?
Has anyone been able to successfully get RedisIdempotentRepository working in a Camel Route?
我的Camel Route是使用Java 8 +,Apache Camel(2.17.1)和Spring Boot(1.3.3.RELEASE)构建的.骆驼路线会加载并处理消息,但不会过滤出重复项:
My Camel Route is built using Java 8+, Apache Camel (2.17.1) and Spring Boot (1.3.3.RELEASE). The Camel Route loads and processes messages but does not filter out duplicates:
from("activemq:generic.order").
idempotentConsumer(header("uniqueId"),
RedisIdempotentRepository.redisIdempotentRepository(redisTemplate,"camel-repo")).
to("activemq:unique.order");
RedisTemplate已连接到本地Redis Server(3.0.4),并注入了Redis连接池.
The RedisTemplate is connected to a local Redis Server(3.0.4) and is injected with a Redis Connection Pool.
我使用内存中的存储库测试了相同的Camel Route,并且邮件被过滤掉了.
I tested the same Camel Route using the in-memory repository and the messages were filtered out.
推荐答案
RedisIdempotentRepository不是问题.我的Redis实例已损坏.上面的解决方案有效:)
RedisIdempotentRepository was not the problem. My Redis instance was corrupted. The solution above works :)
这篇关于Apache Camel RedisIdempotentRepository配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!