Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagejava
producerTemplate.sendBody("grape:defaultMavenCoordinates", "org.apache.camel/camel-ftp/2.15.2".getBytes());

...

Div
classconfluenceTableSmall

Header

Java constant

Endpoint typeValue type

Description

CamelGrapeCommandGrapeConstants.GRAPE_COMMANDProducerorg.apache.camel.component.grape.GrapeCommandThe command to be performed by the Grape endpoint. Default to grab.

 

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
Endpoint See Also
Endpoint See Also