Custom Processor
Use case
This documentation outlines the use-case for message transformation, demonstrating how Java code can be effectively utilized within the Talisman Platform to customize and extend functionality. This approach ensures that users can meet specific requirements by integrating tailored Java code into their workflows.
Design
- Messages are received from a
direct
component - Add
Process
element to inject customProcessor
implementation. - Input class name
- Click
Create Java Class
button to create class from Template
Code
The following code will be generated by the platform:
custom-processor.camel.yaml
- route:
id: route-cb77
nodePrefixId: route-0c0
from:
id: from-1b17
uri: direct
parameters:
name: demo
steps:
- process:
id: process-6ac4
ref: CustomProcessor
CustomProcessor.java
import org.apache.camel.BindToRegistry;
import org.apache.camel.Configuration;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
@Configuration
@BindToRegistry("CustomProcessor")
public class CustomProcessor implements Processor {
public void process(Exchange exchange) throws Exception {
exchange.getIn().setBody("Hello World!!!!!");
}
}
Templates
The platform offers templates for custom Processor and AggregationStrategy implementations, which users can easily adapt and configure to meet specific needs, streamlining development and enhancing system adaptability.