Loading

MuleSoft: HTTP Request operation hangs when using a small responseBufferSize together with the non-blocking writer

Data pubblicazione: Aug 17, 2026
Descrizione

In MuleSoft, when calling an HTTP Request operation with streamResponse=true and a small responseBufferSize (e.g. 100), and the following system property is set to true, the request may appear to hang, showing no response and prolonged delays.

 -Dmule.http.client.responseStreaming.nonBlockingWriter=true

Cause

With the non-blocking writer enabled (i.e. when the above system property is added), a small responseBufferSize causes frequent buffer saturation. Each time the buffer fills up, the write must wait before it can retry, and with a very small buffer these waits accumulate and stall stream processing.

Risoluzione

There are following options to mitigate the issue.

  1. Preferred: Do not set responseBufferSize explicitly (Use default value) or explicitly set responseBufferSize="-1", so the connector uses default dynamic buffer sizing(*).
  2. If a specific buffer size is required, increase responseBufferSize substantially based on observed response patterns.

(*) When option 1 is used, currently a buffer size ranging from tens of kilobytes to 1 megabyte is assigned, depending on the response. If you enable DEBUG logging for the package: "org.mule.service.http.impl.service.client.async.ResponseBodyDeferringAsyncHandler", you can see the following log in application.log when the default dynamic buffer size is used in the application:

DEBUG 2026-08-06 01:23:45,666 xxx org.mule.service.http.impl.service.client.async.ResponseBodyDeferringAsyncHandler: onHeadersReceived. No configured buffer size, resolving buffer size dynamically.

 

Risorse aggiuntive

"-Dmule.http.client.responseStreaming.nonBlockingWriter=true" option is seen in the Knowledge Article: Whitepaper: A Systematic Approach to Resolving 502/504 Errors in High-Volume MuleSoft Architectures

Numero articolo Knowledge

005391036

 
Caricamento
Salesforce Help | Article