Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
Krati ComponentAvailable as of Camel 2.9 This component allows the use krati datastores and datasets inside Camel. Krati is a simple persistent data store with very low latency and high throughput. It is designed for easy integration with read-write-intensive applications with little effort in tuning configuration, performance and JVM garbage collection. Camel provides a producer and consumer for krati datastore_(key/value engine)_. It also provides an idempotent repository for filtering out duplicate messages. Maven users will need to add the following dependency to their <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-krati</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency> URI formatkrati:[the path of the datastore][?options] The path of the datastore is the relative path of the folder that krati will use for its datastore. You can append query options to the URI in the following format, Krati URI Options
You can have as many of these options as you like. krati:/tmp/krati?operation=CamelKratiGet&initialCapacity=10000&keySerializer=#myCustomSerializer For producer endpoint you can override all of the above URI options by passing the appropriate headers to the message. Message Headers for datastore
Usage SamplesExample 1: Putting to the datastore.This example will show you how you can store any message inside a datastore. from("direct:put").to("krati:target/test/producertest"); In the above example you can override any of the URI parameters with headers on the message. <route> <from uri="direct:put"/> <to uri="krati:target/test/producerspringtest"/> </route> Example 2: Getting/Reading from a datastoreThis example will show you how you can read the contnet of a datastore. from("direct:get") .setHeader(KratiConstants.KRATI_OPERATION, constant(KratiConstants.KRATI_OPERATION_GET)) .to("krati:target/test/producertest"); In the above example you can override any of the URI parameters with headers on the message. <route> <from uri="direct:get"/> <to uri="krati:target/test/producerspringtest?operation=CamelKratiGet"/> </route> Example 3: Consuming from a datastoreThis example will consume all items that are under the specified datastore. from("krati:target/test/consumertest") .to("direct:next"); You can achieve the same goal by using xml, as you can see below. <route> <from uri="krati:target/test/consumerspringtest"/> <to uri="mock:results"/> </route> Idempotent RepositoryAs already mentioned this component also offers and idemptonet repository which can be used for filtering out duplicate messages. from("direct://in").idempotentConsumer(header("messageId"), new KratiIdempotentRepositroy("/tmp/idempotent").to("log://out"); See also |