Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8051509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:19:08+00:00 2026-06-05T07:19:08+00:00

We are using Apache Camel as an orchestration engine. Typically, the following scenario: client

  • 0

We are using Apache Camel as an orchestration engine. Typically, the following scenario:

client sends HTTP request <-> CAMEL code <-> external server(s)

The ball starts to roll when our client sends a HTTP request to our CAMEL code.
The Camel code will trigger external servers via REST HTTP calls.
Eventually, the Camel code will send a reply back to the client.

The last action before sending the response back to the client, the Camel code sends a HTTP GET towards an external server. So a TCP connection is setup first, then the data sent. After some time (this might take up 5 to 10 seconds), the external server replies with a 200 OK.

Problem: Camel does not send a TCP FIN to the external server after receiving the 200 OK. As a result, the TCP connection remains open … (the external server then closes the TCP connection itself after a timeout of 200 seconds, but this means a TCP resource lost during 200 seconds).

So, at TCP level, it goes like this:

Camel <———-> external server

   TCP SYN  -->
   <-- TCP SYN,ACK
   TCP ACK  -->

   HTTP GET -->
   <-- 200 OK
   TCP ACK  -->

   <200 seconds later>
   <-- TCP FIN,ACK
   TCP ACK  -->

Any idea how I can have Camel close the TCP connection after it has received the 200 OK ?

Note: I tried adding the “Connection: close” header, but Camel did not add the header ?! It seemed to ignore it …

This was the code to add the header:

exchange.getOut().setHeader("Connection","Close");

I am using Camel 2.9.1 in a Spring framework with Eclipse IDE.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:19:09+00:00Added an answer on June 5, 2026 at 7:19 am

    Unfortunately, I did not see another solution than create a custom HttpHeaderFilterStrategy class which does not filter out the Connection header.
    Then before sending out my request to the external server, I am setting the header “Connection: close”. As soon as this request gets replied, the Camel code then sends a TCP FIN, ACK in order to close the TCP connection.

    More details:

    1) create a custom HttpHeaderFilterStrategy class, eg: CustomHttpHeaderFilterStrategy

    2) adapt the applicationContext.xml so it points to that class, eg:

    <bean id="http" class="org.apache.camel.component.http.HttpComponent">
        <property name="camelContext" ref="camel"/>
        <property name="headerFilterStrategy" ref="myHeaderFilterStrategy"/>
    </bean>
    
    <bean id="myHeaderFilterStrategy" class="com.alu.iptc.com.CustomHttpHeaderFilterStrategy">
    </bean>
    

    3) adapt your code, so that the Connection: close header is set, eg:

    exchange.getOut().setHeader("Connection","close");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I do multipart file uploads using the Apache Camel HTTP component ?
I have tried search using Apache SOLR. I have done with the PHP client
I'm trying to integrate Google Places API using Apache Camel (2.10-SNAPSHOT) and Spring (3.0.7.RELEASE)
I'm trying to expose a web service using fuse esb + apache camel +
I'm trying to run the Camel Example camel-example-spring-jms (also at http://activemq.apache.org/camel/tutorial-jmsremoting.html ). However, when
We're using camel routes to post values from a queue to an http endpoint.
In my application build using apache camel (mavenized, spring dsl) , i am reading
I was trying to materialize apache Camel project in my eclipse environment. I'm using
I have CollabNet Subversion server and client installed, running off of Apache that came
I am integrating data between two systems using Apache Camel. I want the resulting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.