Your Mule application intermittently stops processing requests from an upstream system (e.g., SAP). The upstream system reports errors such as timeouts, HTTP 504/503, or connection refused. While the Mule application appears to be running normally without internal errors, new inbound requests are not processed. A restart of the application temporarily resolves the issue.
The application logs show no Mule-level errors or warnings during normal operation, because the failures occur at the TCP/NIO layer before the inbound request reaches the Mule flow. Enabling HTTP wire logging (org.mule.service.http.impl.service.HttpMessageLogger at DEBUG) shows the listener responding with a Keep-Alive header and holding connections open after each response.
CAUSE
By default, the Mule HTTP Listener keeps inbound TCP connections open after responding (usePersistentConnections defaults to true) so they can be reused for subsequent requests. This is efficient when the client honors keep-alive and reuses the same connection.
The problem arises when the upstream system (e.g., SAP) opens a NEW connection for every request and never reuses the previously opened ones. The old connections are left open longer than they would be reaped, causing them to accumulate over time. Eventually the listener's available connection resources are exhausted, and new inbound connections can no longer be accepted — producing timeouts, HTTP 503/504, or connection-refused errors from the client's perspective.
Because the bottleneck is at the TCP/listener layer (before the Mule flow executes), the application's internal processing appears healthy and no errors are logged. Restarting the application clears all accumulated connections, which is why a restart provides temporary relief.
SOLUTION
Choose the option that matches your upstream client's connection behavior.
Option 1 — Reduce the idle connection timeout (less invasive; preferred when some clients DO reuse connections)
Lower connectionIdleTimeout on the http:listener-connection so the listener reaps idle connections sooner than the 40-second default. This preserves connection reuse for well-behaved clients while preventing accumulation from clients that abandon connections. Note: this attribute is only effective while usePersistentConnections is true.
<http:listener-config name="HTTP_Listener_Config" doc:name="HTTP Listener config">
<http:listener-connection host="0.0.0.0" port="${http.port}"
connectionIdleTimeout="10000" />
</http:listener-config>
Option 2 — Disable persistent connections (definitive fix when the client never reuses connections)
If the upstream system opens a new connection for every request and never reuses them (as is typical with certain SAP configurations), disable persistent connections. The listener will then close each connection immediately after sending its response, so no idle connections can accumulate.
<http:listener-config name="HTTP_Listener_Config" doc:name="HTTP Listener config">
<http:listener-connection host="0.0.0.0" port="${http.port}"
usePersistentConnections="false" />
</http:listener-config>
<flow name="your-flow">
<http:listener config-ref="HTTP_Listener_Config" path="/your-path" doc:name="HTTP Listener"/>
<!-- Your application logic -->
</flow>
IMPORTANT TRADE-OFF: Disabling persistent connections forces a full TCP handshake (and TLS handshake, if HTTPS) on every request. For high-throughput APIs this adds measurable per-request latency and overhead. Only apply Option 2 when the client does not reuse connections — if the client honors keep-alive, prefer Option 1. When usePersistentConnections is set to false, connectionIdleTimeout has no effect, as connections are closed immediately.
Steps to apply:
As a general best practice for high-volume applications, also review your worker/replica sizing to ensure adequate resources for peak throughput.
APPLIES TO
005388238

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.