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.
Kestrel ComponentThe Kestrel component allows messages to be sent to a Kestrel queue, or messages to be consumed from a Kestrel queue. This component uses the spymemcached client for memcached protocol communication with Kestrel servers. The kestrel project is inactive and the Camel team regard this components as deprecated.
URI formatkestrel://[addresslist/]queuename[?options] Where queuename is the name of the queue on Kestrel. The addresslist part of the URI may include one or more kestrel://kserver01:22133/foo If the addresslist is omitted, kestrel://foo Likewise, if a port is omitted from a kestrel://kserver01/foo Here is an example of a Kestrel endpoint URI used for producing to a clustered queue: kestrel://kserver01:22133,kserver02:22133,kserver03:22133/massive Here is an example of a Kestrel endpoint URI used for consuming concurrently from a queue: kestrel://kserver03:22133/massive?concurrentConsumers=25&waitTimeMs=500 OptionsYou can configure properties on each Kestrel endpoint individually by specifying them in the
NOTE: If waitTimeMs is set to zero (or negative), the Configuring the Kestrel component using Spring XMLThe simplest form of explicit configuration is as follows: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <bean id="kestrel" class="org.apache.camel.component.kestrel.KestrelComponent"/> <camelContext xmlns="http://camel.apache.org/schema/spring"> </camelContext> </beans> That will enable the Kestrel component with all default settings, i.e. it will use To use specific options in the base configuration (which supplies configuration to endpoints whose <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <bean id="kestrelConfiguration" class="org.apache.camel.component.kestrel.KestrelConfiguration"> <property name="addresses" value="kestrel01:22133"/> <property name="waitTimeMs" value="100"/> <property name="concurrentConsumers" value="1"/> </bean> <bean id="kestrel" class="org.apache.camel.component.kestrel.KestrelComponent"> <property name="configuration" ref="kestrelConfiguration"/> </bean> <camelContext xmlns="http://camel.apache.org/schema/spring"> </camelContext> </beans> Usage ExamplesExample 1: Consumingfrom("kestrel://kserver02:22133/massive?concurrentConsumers=10&waitTimeMs=500") .bean("myConsumer", "onMessage"); public class MyConsumer { public void onMessage(String message) { ... } } Example 2: Producingpublic class MyProducer { @EndpointInject(uri = "kestrel://kserver01:22133,kserver02:22133/myqueue") ProducerTemplate producerTemplate; public void produceSomething() { producerTemplate.sendBody("Hello, world."); } } Example 3: Spring XML Configuration<camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="kestrel://ks01:22133/sequential?concurrentConsumers=1&waitTimeMs=500"/> <bean ref="myBean" method="onMessage"/> </route> <route> <from uri="direct:start"/> <to uri="kestrel://ks02:22133/stuff"/> </route> </camelContext> public class MyBean { public void onMessage(String message) { ... } } DependenciesThe Kestrel component has the following dependencies:
spymemcachedYou must have the <dependency> <groupId>spy</groupId> <artifactId>memcached</artifactId> <version>2.5</version> </dependency> Alternatively, you can download the jar directly. Limitations NOTE: The spymemcached client library does not work properly with kestrel when JVM assertions are enabled. There is a known issue with spymemcached when assertions are enabled and a requested key contains the Fortunately, JVM assertions are disabled by default, unless you explicitly enable them, so this should not present a problem under normal circumstances. Something to note is that Maven's Surefire test plugin enables assertions. If you're using this component in a Maven test environment, you may need to set |