Using Camel Consumer and Producer Applications

Camel Consumer and Producer applications allow you to specify arbitrary Camel Routes to be invoked from activities in Process Models at runtime and ensure connectivity via simple XML configurations leveraging the connectivity capabilities of Apache Camel.

Creating a Camel Consumer / Producer Application

To create a Camel Consumer application:

  1. Select Applications > Camel Consumer Application in the diagram toolbar.

    Create Camel Consumer Application
    Figure: Create a Camel Consumer Application

  2. Click on the diagram to place the symbol for the Camel Consumer application there.

    Camel Consumer Application
    Figure: Camel Consumer Application

To create a Camel Producer application:

  1. Select Applications > Camel Producer Application in the diagram toolbar.

    Create Camel Producer Application
    Figure: Create a Camel Producer Application

  2. Click on the diagram to place the symbol for the Camel Producer application there.

    Camel Producer Application
    Figure: Camel Producer Application

Setting Application Properties

Double-click the application symbol to open the properties page. Select General Tab to open the Camel specific properties section.

Camel Application Properties Page
Figure: Camel Producer Application Properties Page

General Tab

In the General Tab section, you can set properties for the following:

CamelContextID

The CamelContextID defines the ID of the CamelContext object, which represents the Camel runtime system.

Invocation Pattern

In the Invocation Pattern drop-down list you may specify the invocation pattern.

Set Endpoint Pattern
Figure: Set Invocation Pattern

A Camel application can follow the invocation pattern of the following types depending if it is a Consumer or Producer application:

Body Access Points

The Body Input Access Point and Body Output Access Point define the data values for the body of the exchange. All other access points defined in the Typed Access Points section will be set to the header of the exchange.

Selecting an Body Input Access Points
Figure: Selecting an Body Input Access Points

In the drop-down list all access point, which were defined in the Typed Access Points section for input and output respectively, are available for selection.

Body Access Points
Figure: Body Access Points

Additional Spring Bean Definitions

You may use references to Spring Beans in your routes. These Spring Beans are either expected to be defined externally in your runtime environment or can be defined in the Additional Spring Bean Definitions text area:

Spring Bean Definition
Figure: Spring Bean Definition

Hereby, the byte code of com.siriussuper.order.OrderCache is expected to be available in your runtime deployment, e.g. by adding a Utility JAR file with this byte code to your Solution Release.

Producer Route

All routes based on a Camel application type definition are created and started at application startup by the Spring bean. Routes get stopped and recreated after each model deployment even if a process model is overridden. If a model is deleted from the Audit Trail database, all routes based on a Camel application type defined for this process model will be stopped and removed from the Camel Context.

In the Producer Route section you can define arbitrary Camel Routes to be invoked from activities in the Process Model at runtime, like:

Simple Route example
Figure: Simple Route example

or more complex cases like

Complex Route example
Figure: Complex Route example

In all cases, you need to ensure that the Camel Components used in the tags are part of your Runtime Environment setup.

Additionally, you can set the following options:

These options are enabled by default.

Consumer Route

In the Consumer Route section you can define arbitrary Camel Routes to be invoked from activities in the Process Model at runtime, like:

Consumer Route example
Figure: Consumer Route example

Note that you need to ensure that the Camel Components used in the tags are part of your Runtime Environment setup.

Additionally, you can set the following options:

These options are enabled by default.

Typed Access Points

In the Typed Access Points section, you can define parameters to access the data associated with the application. You can specify multiple In or Out access points for the Camel Endpoint to invoke the Web service.

You can define input or output parameters. A Camel application automatically determines if the application type is send only/or send and receive. If at least one out mapping is provided, the application is considered send/receive. If no out data mapping is provided, the application is considered as send only.

To add an input parameter, click Add Input.

Add Input
Figure: Add an input parameter

Add a parameter name and select the data type with its matching type definition. Supported data types are:

Add Parameter
Figure: Add parameter details

To add an output parameter, click Add Output.

Add Output
Figure: Add an output parameter

Enter details similar as for an input parameter.

The added parameters are now available for selection in the Body Access Points section. For example, if you enter the following parameters as input and output access points:

Example parameters
Figure: Example parameters

One of the input parameters can be selected as body input access point and one of the output parameters can be selected as body output access point in the Body Access Points section.

Available Parameters
Figure: Parameters available in drop-down list