tuk
tuk

Reputation: 6852

Camel guaranteed delivery using Redis

Can someone let me know how to do guaranteed delivery using camel-redis?

My use case is something like below:-

from("jetty:http://localhost:8888/hello").to("redis://...") 

Once the message is written to redis send a success response to http client, so that the client is not blocked waiting for response.

Then in another route I want to process the message from redis like below and then deleting it from redis when the processing is successful

from("redis://...").to(...)

Upvotes: 0

Views: 718

Answers (1)

gusto2
gusto2

Reputation: 12075

Good approach - it is called "store and forward" pattern.

and the message is not delivered to the final destination?

then - what about the "try/catch"? try to send the message and when fails, just put it back to the redis.

Usually this pattern is implemented using messaging (JMS), where the messaging is having some important features: the destination, the retry count, retry periode and the dead-letter queue, etc.

Using any simpler store (redis, jdbc, ...) you will have to implement these messaging features by yourself. (I must admin I am not good with Redis, but the same issue comes with using simple JDBC as a message store).

At least add the retry count and "next delivery timestamp". And what happens when the message is not delivered after predefined count - it's up to you - send a mail, write a log, stop the world..

Upvotes: 1

Related Questions