Usage Samples - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

Example 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>

Here is how the above example would look like using xml to define our route.

Example 2: Getting/Reading from a datastore

This 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.

Here is how the above example would look like using xml to define our route.

<route>
     <from uri="direct:get"/>
     <to uri="krati:target/test/producerspringtest?operation=CamelKratiGet"/>
</route>

Example 3: Consuming from a datastore

This 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.

from("krati:target/test/consumertest")
    .to("direct:next");