Decoupled responses - 7.3

Talend ESB Service Developer Guide

Version
7.3
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend ESB
Talend Runtime
Content
Design and Development
Installation and Upgrade
Last publication date
2023-04-17

By default, WS-Addressing using anonymous Reply-To addresses. This means the request/response patterns are synchronous in nature and the response will be sent back via the normal reply channel. However, WS-Addressing allows for a decoupled endpoint to be used for receiving the response with CXF then correlating it with the appropriate request. There are a few ways for configuring the address on which CXF will listen for decoupled WS-Addressing responses. For HTTP conduit configuration, its client configuration has an option for a DecoupledEndpoint address. If the conduit has this configured, all requests sent via that conduit will have WS-Addressing enabled and their responses sent to that endpoint:

<http:conduit 
   name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit"> 
   <http:client 
      DecoupledEndpoint="http://localhost:9090/decoupled_endpoint"/> 
</http:conduit>

The address can also be set via a Request Context property:

((BindingProvider)proxy).getRequestContext() 
   .put("org.apache.cxf.ws.addressing.replyto", 
   "http://localhost:9090/decoupled_endpoint");

The CXF AddressingPropertiesImpl object can be used to control many aspects of WS-Addressing including the Reply-To:

AddressingProperties maps = new AddressingPropertiesImpl(); 
EndpointReferenceType ref = new EndpointReferenceType(); 
AttributedURIType add = new AttributedURIType(); 
add.setValue("http://localhost:9090/decoupled_endpoint"); 
ref.setAddress(add); 
maps.setReplyTo(ref); 
maps.setFaultTo(ref); 

((BindingProvider)port).getRequestContext() 
   .put("javax.xml.ws.addressing.context", maps);

This method can also be used to configure the namespace (version) of the WS-Addressing headers, exact message ID's, and similar information.