Apache Camel HTTP client intermittently delays requests to IIS/.NET SOAP backend causing SocketTimeoutException

16 hours ago 1
ARTICLE AD BOX

I have an Apache Camel XML built on SpringBoot DSL based REST microservice that acts as a transformation middleware layer.

Flow:

REST JSON request --> Apache Camel XML routes

Camel transforms JSON into SOAP XML

Camel invokes a SOAP backend hosted on Windows IIS (.NET Framework)

We are intermittently observing network/execution delays where the request from Camel appears to reach the SOAP backend late, and eventually Camel throws timeout exceptions.

Symptoms

Requests intermittently take a long time before backend execution starts

Some requests succeed normally

Some requests timeout after long waits

Backend team says they sometimes see the request arriving late from Camel side

Apache Camel layer eventually throws SocketTimeoutException

Exception

Suppressed: java.net.SocketTimeoutException: Read timed out at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:278) at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:304) at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346) at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796) at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1099) at org.apache.hc.core5.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:149) at org.apache.hc.core5.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280) at org.apache.hc.core5.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:247) at org.apache.hc.core5.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:54) at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:304) at org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:175) at org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:218) at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint.execute(PoolingHttpClientConnectionManager.java:717) at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.execute(InternalExecRuntime.java:216) at org.apache.hc.client5.http.impl.classic.MainClientExec.execute(MainClientExec.java:116) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)

Apache Camel application.properties

# ============ HTTP POOLING ========================== camel.component.http.max-total-connections=300 camel.component.http.connections-per-route=100 camel.component.http.connect-timeout=2000 camel.component.http.connection-request-timeout=1000 camel.component.http.response-timeout=120000 camel.component.http.so-timeout=120000 camel.component.http.connection-time-to-live=300000 camel.component.http.cookie-management-disabled=true camel.component.http.automatic-retries-disabled=true camel.component.http.client-connection-manager=#bean:pooledConnectionManager camel.component.http.log-http-activity=true # ======================================================= # ===== Circuit Breaker Config ====== cb.failureRateThreshold=50 cb.minimumNumberOfCalls=10 cb.waitDurationInOpenState=60000 cb.slidingWindowSize=20 cb.permittedNumberOfCallsInHalfOpenState=5 cb.timeoutDuration=110000

Additional Info

Using Apache Camel HTTP component with Apache HttpClient5 pooling

Backend is SOAP service hosted on IIS using .NET Framework

Issue is intermittent and difficult to reproduce consistently

No CPU/memory spikes observed on Camel application

Questions

Could this be caused by stale/blocked pooled HTTP connections in Camel HttpClient5?

Same behavior is observed even without HTTP pooling.

Is there a possibility IIS connection queueing or app pool thread starvation is delaying request processing?

What are the best ways to diagnose whether delay occurs:

before request leaves Camel

during network transit

inside IIS/.NET backend

Has anyone seen intermittent delayed execution between Apache Camel and IIS-hosted SOAP services?

Any suggestions on debugging strategies, HttpClient tuning, IIS settings, or TCP/network analysis would be appreciated.

Tech stack:

Apache Camel (4.8.0) XML DSL

Java 17

SpringBoot v3.3.6

Apache HttpClient5

IIS on Windows Server

SOAP (.NET Framework backend)

Read Entire Article