Petals-SE-Camel 1.0.1+

compared with
Version 5 by Victor NOËL
on Feb 26, 2016 09:52.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (1)

View Page History
{warning}

h1. Accessing Petals interface name, service, operation names, MEP, headers and endpoint information of a from() in the Camel route

The Camel exchange contains properties for the informations from the received Petals exchange.
They are named: "PetalsOriginalInterface" (a QName), "PetalsOriginalService" (a QName), "PetalsOriginalEndpoint" (a ServiceEndpoint), "PetalsOriginalOperation" (a QName), "PetalsOriginalPattern" (an URI).

Also, it contains all the headers of the received Petals exchange, they are prefixed by "PetalsOriginalHeader."

h1. Specifying service name, endpoint name, operation name, MEP and headers of a to() in the Camel route

When defining Consumes in the jbi.xml, it is not mandatory to specify the service name and endpoint name, but actually neither the operation and mep.

Concerning the service, the endpoint and the operation names, they are not mandatory elements to be set on a Petals exchange.
Inversely, the MEP should always be specified on a Petals exchange.

h2. Specifying parameters on the endpoint URI

One way to influence the service, endpoint, operation names and the MEP is to set parameters on the endpoint URI in the Camel route like this:

{code:lang=java}
@Override
public void configure() throws Exception {
from("petals:theProvidesId").to("petals:theConsumesId?serviceName={http://a.com/namespace}AService&endpointName=edpt-name&operation={http://a.com/namespace}anOperation&exchangePattern=InOut");
}
{code}

Of course each can be used alone or together, but the following rules always apply:
* If a parameter is set in the Consumes, it can't be set in the Camel endpoint URI
* endpointName can only be set if either the Consumes or the endpoint URI have a serviceName set

h2. Using the MEP of the Camel exchange

Even though it's not the most recommended (because of its implicit nature), if no MEP is set neither on the Consumes or the Camel endpoint URI, then the MEP of the Camel exchange will be used.

h2. Setting headers on the Petals exchange

If the Camel exchange contains properties prefixed by "PetalsHeader.", then they will be added to the Petals exchange upon creation (without the prefix).

h1. Examples