MuleSoft · HTTP Connector

Remotely closed

Short answer

A Remotely closed error means the HTTP connector reused a pooled connection that the remote system had already closed. Set Connection Idle Timeout on the HTTP Request configuration lower than the remote system's idle timeout, for example 10000 to 12000 milliseconds.

VerifiedLast verified

01Error text

MuleSoft error
Remotely closed

Remote host closed connection

02Likely causes

  • The connector reuses a stale pooled connection when connectionIdleTimeout is longer than the remote system's idle timeout.
  • CloudHub 2.0 ingress closes idle connections after 15 seconds.
  • Salesforce typically closes connections after 30 seconds of inactivity.

03How to fix it

  1. Find the idle or keep-alive timeout of the remote system or of the load balancer in front of it.
  2. Set Connection Idle Timeout on the HTTP Request configuration to a lower value, for example connectionIdleTimeout="12000". The docs recommend less than 15000, for example 10000 to 12000.
  3. Know the built-in retry: on a Remotely Closed error the operation retries PUT, DELETE, GET, HEAD, OPTIONS and TRACE requests three times. The property mule.http.client.maxRetries changes the count, and 0 turns the retry off.
  4. To extend the built-in retry to every method, set mule.http.client.retryOnAllMethods=true. Do this only if repeating the request is safe.

04Official documentation

Test every fix in a non-production environment before you apply it to production. See how entries are verified.

More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer

The iPaaS Brief

Subscribe to The iPaaS Brief.

The iPaaS newsletter for the people who run integrations. From iPaaS Group.

Free. You finish on theipaasbrief.com and confirm by email.