Apache Camel RedisIdempotentRepository Configuration

不问归期 提交于 2019-12-10 21:54:13

问题


Has anyone been able to successfully get RedisIdempotentRepository working in a 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");

The RedisTemplate is connected to a local Redis Server(3.0.4) and is injected with a Redis Connection Pool.

I tested the same Camel Route using the in-memory repository and the messages were filtered out.


回答1:


RedisIdempotentRepository was not the problem. My Redis instance was corrupted. The solution above works :)



来源:https://stackoverflow.com/questions/36389873/apache-camel-redisidempotentrepository-configuration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!