You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Carsten <ca...@kopis.de> on 2014/11/10 16:42:23 UTC

Custom ShutdownStrategy to persist inflightexchanges?

Hi all,

I'm thinking about implementing a custom ShutdownStrategy to persist 
inflight exchanges to disk (or database). The reason for this is that we 
can't rely on a Messaging middleware to take care of the persistence, 
but we want to be able to shutdown routes without loosing those inflight 
exchanges.

Is anyone doing something like this?

My initial thought was this:

In my custom ShutdownStrategy I persist the inflight exchanges of one 
route to a directory in the local filesystem on shutdown, going for a 
fast shutdown. When the application comes up again, one route is 
listening for files in that directory and picking up previously stored 
messages again, deleting the files after they are handed over to the 
original route. If there are inflight exchanges on the 2nd route when 
receiving a shutdown, that inflight exchanges can be discarded.

I'd appreciate any feedback if someone is already doing this kind of 
shutdown or if I should avoid going down this path.


thanks,

Carsten