Sunday, March 20, 2016

ESB 4.9.0 Call mediator, How to get the response headers when the blocking enabled.

In ESB 4.9.0, The Call mediator can invoke a service, either in a synchronous or asynchronous manner. If we use the call mediator in an asynchronous manner (blocking=false) it uses the default pass through transport implementation of the ESB. When the blocking enabled it uses the blocking message sender to send the request to the backend and will wait on the same thread until the response arrive.

If we require to preserver the response message headers we required to set the following property before the call mediator.


  <property name="BLOCKING_SENDER_PRESERVE_REQ_HEADERS" value="false"/>  

Sample proxy configuration

 <?xml version="1.0" encoding="UTF-8"?>  
 <proxy xmlns="http://ws.apache.org/ns/synapse"  
     name="first"  
     transports="https"  
     statistics="enable"  
     trace="enable"  
     startOnLoad="true">  
   <target>  
    <inSequence>  
      <property name="BLOCKING_SENDER_PRESERVE_REQ_HEADERS" value="false"/>  
      <call blocking="true">  
       <endpoint>  
         <address uri="https://localhost:8243/services/backend1"  
             trace="enable"  
             statistics="enable"/>  
       </endpoint>  
      </call>  
      <log level="full"/>  
    </inSequence>  
    <outSequence/>  
   </target>  
   <description/>  
 </proxy>  

No comments :

Post a Comment