Available as of Camel 2.3
Current features it provides:
HawtDBAggregationRepository is an AggregationRepository which on the fly persists the aggregated messages. This ensures that you will not loose messages, as the default aggregator will use an in memory only AggregationRepository.
It has the following options:
|repositoryName||String||A mandatory repository name. Allows you to use a shared HawtDBFile for multiple repositories.|
|persistentFileName||String||Filename for the persistent storage. If no file exists on startup a new file is created.|
|bufferSize||Integer||The size of the memory segment buffer which is mapped to the file store. By default its 64mb. The value is in bytes.|
|sync||boolean||Whether or not the HawtDBFile should sync on write or not. Default is false. This option is only in use if persistentFileName is used.|
|hawtDBFile||HawtDBFile||Use an existing configured org.apache.camel.component.hawtdb.HawtDBFile instance.|
|returnOldExchange||boolean||Whether the get operation should return the old existing Exchange if any existed. By default this option is false to optimize as we do not need the old exchange when aggregating.|
|useRecovery||boolean||Whether or not recovery is enabled. This option is by default false. You can enable this to let Camel Aggregator automatic recover failed aggregated exchange and have them resubmitted.|
|checkInterval||long||If recovery is enabled then a background task is run every x time to scan for failed exchanges to recover and resubmit. By default this interval is 5000 millis.|
The repositoryName option must be provided. Then either the persistentFileName or the hawtDBFile must be provided.
HawtDBAggregationRepository will only preserve any Serializable compatible data types. If a data type is not such a type its dropped and a WARN is logged. And it only persists the Message body and the Message headers. The Exchange properties are not persisted.
In this example we want to persist aggregated messages in the target/data/hawtdb.dat file.
The same example but using Spring XML instead:
To use HawtDB in your camel routes you need to add the a dependency on camel-hawtdb.
If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions).