Correlation ID Policy - 6.3

Talend ESB Service Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
Installation and Upgrade
EnrichPlatform
Talend ESB

The correlation ID feature provides support for setting a business correlation ID. A correlation ID can be set using:

Maven project dependency

To use the Correlation ID policy in your project, you have to implement the following dependency:

<dependency>
   <groupId>org.talend.esb.policies</groupId>
   <artifactId>correlationid-policy</artifactId>
</dependency>

Custom callback handler

The custom callback handler can be enabled via feature (supports both Soap and REST service):

<jaxrs:features>
    <bean class="org.talend.esb.policy.correlation.feature.CorrelationIDFeature"/>
</jaxrs:features>

<jaxws:properties>
  <entry key="correlation-id.callback-handler">
    <bean class="com.example.CorrelationHandler"/>
  </entry>
</jaxws:properties>

The bean class com.example.CorrelationHandler is a custom class which implements the org.talend.esb.policy.correlation.CorrelationIDCallbackHandler interface. If such callback class is not specified in the properties, then the correlation Id will be generated automatically by a default callback handler which provides a system UID. For more information, see Automated correlation ID generation (system UID).

It is also necessary to specify the correlation id handler:

<jaxws:properties>
  <entry key="correlation-id.callback-handler">
    <bean class="com.example.CorrelationHandler"/>
  </entry>
</jaxws:properties>

Automated correlation ID generation (system UID)

If you do not specify a callback handler and set type="callback" (or entirely omit the type attribute), then the id will be generated automatically as system UID, and the value will be the same for request and response:

Enabling via feature:

<jaxrs:features>
    <bean class="org.talend.esb.policy.correlation.feature.CorrelationIDFeature"/>
</jaxrs:features>