Apache Camel RedisIdempotentRepository 配置 [英] Apache Camel RedisIdempotentRepository Configuration
问题描述
有没有人能够成功地让 RedisIdempotentRepository 在 Camel Route 中工作?
Has anyone been able to successfully get RedisIdempotentRepository working in a Camel Route?
My Camel Route 是使用 Java 8+、Apache Camel (2.17.1) 和 Spring Boot (1.3.3.RELEASE) 构建的.Camel Route 加载和处理消息,但不会过滤掉重复的消息:
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屋!