THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
But of course Camel build-in type conversion API can perform the automatic data type transformations for you. In the example below Camel automatically converts binary payload into String:
Code Block | ||
---|---|---|
| ||
producerTemplate.sendBody("grape:defaultMavenCoordinates", "org.apache.camel/camel-ftp/2.15.2".getBytes()); |
...
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
Loading components at runtime
In order to load the new component at the router runtime, just grab the jar containing the component:
Code Block |
---|
ProducerTemplate template = camelContext.createProducerTemplate(); template.sendBody("grape:grape", "org.apache.camel/camel-stream/2.15.2"); template.sendBody("stream:out", "msg"); |
Loading processors bean at runtime
In order to load the new processor bean with your custom business login at the router runtime, just grab the jar containing the bean:
Code Block |
---|
ProducerTemplate template = camelContext.createProducerTemplate();
template.sendBody("grape:grape", "com.example/my-business-processors/1.0");
int productId = 1;
int price = template.requestBody("bean:com.example.PricingBean?method=currentProductPrice', productId, int.class) |
Include Page | ||||
---|---|---|---|---|
|