THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Wiki Markup |
---|
h2. Kestrel Component
The Kestrel component allows messages to be sent to a [Kestrel|https://github.com/robey/kestrel] queue, or messages to be consumed from a Kestrel queue using the [Spymemcached|http://code.google.com/p/spymemcached/] client.
h3. URI format
{code}
kestrel://[addresslist/]queuename[?options]
{code}
Where *queuename* is a Kestrel queue name. The *addresslist* part of the URI may include one or more {{host:port}} pairs. For example, to connect to the queue {{foo}} on {{kserver01:22133}}, use:
{code}
kestrel://kserver01:22133/foo
{code}
If the *addresslist* is omitted, {{localhost:22133}} is assumed, i.e.:
{code}
kestrel://foo
{code}
Likewise, if a port is omitted from a {{host:port}} pair in *addresslist*, the default port 22133 is assumed, i.e.:
{code}
kestrel://kserver01/foo
{code}
h3. Options
You can configure properties on each Kestrel endpoint individually by specifying them in the {{?parameters}} portion of the endpoint URI. Any {{?parameters}} that are omitted will default to what is configured on the KestrelComponent's base KestrelConfiguration. The following properties may be set on KestrelConfiguration and/or each individual endpoint:
{div:class=confluenceTableSmall}
|| Option || Default Value || Description ||
| {{waitTimeMs}} | {{100}} | Specifies the {{/t=...}} wait time passed to Kestrel on GET requests. |
| {{concurrentConsumers}} | {{1}} | Specifies the number of concurrent consumers. |
{div}
h3. Configuring the Kestrel component using Spring XML
The simplest form of explicit configuration is as follows:
{code:xml}
<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-2.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring">
</camelContext>
<bean id="kestrel" class="org.apache.camel.component.kestrel.KestrelComponent"/>
</beans>
{code}
That will enable the Kestrel component with all default settings, i.e. it will use {{localhost:22133}}, 100ms wait time, and 1 concurrent consumer by default.
To use specific options in the base configuration (which supplies configuration to endpoints whose {{?properties}} are not specified), you can set up a KestrelConfiguration POJO as follows:
{code:xml}
<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-2.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring">
</camelContext>
<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>
</beans>
{code}
h3. Getting Component JAR
You will need these dependencies
- {{spymemcached}} 2.5+
h4. spymemcached
You *must* have the {{spymemcached}} jar on your classpath. Here is a snippet you can use in your pom.xml:
{code}
<dependency>
<groupId>spy</groupId>
<artifactId>memcached</artifactId>
<version>2.5</version>
</dependency>
{code}
{include:Endpoint See Also} |
...