title: Mule ESB synchronous Until Successful payload modification
body: <p>I've spent hours trying to solve my problem which seems to be caused by synchronous Until Successful Scope in Mule ESB v3.5.0. It seems to modify message payload when sending an outbound HTTP requests.</p>
  
  <p>I need to continue in my flow after outbound HTTP request successfully returns from a HTTP server (which sometimes has connection problems). Thus I need the sync variant of Until Successful. For now I use just a simple Logger after the Until Successful block.</p>
  
  <p>The body of my HTTP request is a XML file. When there is no problem at my server and the Until Successful doesn't need to make another HTTP request again, I receive the XML which I sent.</p>
  
  <p>However, when there is a connectivity problem so the Until Successful repeats requesting a few times and then the server goes back online, on my server I receive an instance of <code>org.apache.commons.httpclient.methods.PostMethod</code> instead of the sent XML in the request body!</p>
  
  <p>So no more XML on my server. It seems this sync Until Successful simply discards the original message payload...</p>
  
  <p>The standard async variant of Until Successful works as intended - getting XML in requests all the time.</p>
  
  <p>Here is a minimal sample of HTTP outbound endpoint with Until Successful:</p>
  
  <pre><code>  &lt;flow name="perform" doc:name="performHTTP"&gt;
        &lt;until-successful  maxRetries="${repeater.retries}" millisBetweenRetries="${repeater.period}" failureExpression="#[exception != null &amp;amp;&amp;amp; (exception.causedBy(java.net.ConnectException) || exception.causedBy(java.net.SocketTimeoutException)) || message.inboundProperties['http.status'] != 200]"  doc:name="Until Successful - Repeater" synchronous="true"&gt;
            &lt;http:outbound-endpoint exchange-pattern="request-response" host="${https.outbound.address}" port="${https.outbound.port}" path="${https.outbound.path}" method="POST"  mimeType="text/xml"  transformer-refs="Custom_Outbound_HTTPS_Header" contentType="text/xml" doc:name="HTTPS - Outbound" doc:description="Outcoming HTTPS connection" responseTimeout="15000"/&gt;
        &lt;/until-successful&gt;
  
        &lt;logger message="#['Sending done']" level="INFO" doc:name="Logger - Done"/&gt;
    &lt;/flow&gt;
  </code></pre>
  
  <p><strong>Long story short:</strong></p>
  
  <ul>
  <li><p><strong>synchronous Until Successful: XML -> HTTP request - { NET } - HTTP request -> org.apache.commons.httpclient.methods.PostMethod</strong></p></li>
  <li><p><strong>asynchronous Until Successful: XML -> HTTP request - { NET } - HTTP request -> XML</strong></p></li>
  </ul>