Skip to content

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

Image title

  1. Messages are received from a direct component
  2. Add Process element to inject custom Processor implementation.
  3. Input class name
  4. 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.

Image title