Kamelet
Kamelets (Kamel route snippets) allow users to connect to external systems via a simplified interface, hiding all the low level details about how those connections are implemented.
The Kamelet EIP allows calling Kamelets (i.e. Route Template). When calling a Kamelet you may just refer to the name (template id) of the Kamelet in the EIP as shown below:
Options
The Kamelet eip supports 1 options, which are listed below.
Name | Description | Default | Type |
---|---|---|---|
name |
Required Name of the Kamelet (templateId/routeId) to call. Options for the kamelet can be specified using uri syntax, eg mynamecount=4&type=gold. |
String |
|
description |
Sets the description of this node. |
DescriptionDefinition |
Using Kamelet EIP
from("direct:start")
.kamelet("foo")
.to("mock:result");
And in XML
<route>
<from uri="direct:start"/>
<kamelet name="foo"/>
<to uri="mock:result"/>
</route>
Camel will then, when starting:
-
Lookup the Route Template with the given id (in the example above its foo) from the
CamelContext
-
Create a new route based on the Route Template
Dependency
The implementation of the Kamelet EIP is located in the camel-kamelet
JAR, so you should add the following dependency:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-kamelet</artifactId>
<!-- use the same version as your Camel core version -->
<version>x.y.z</version>
</dependency>
See Also
See the example camel-example-kamelet.