Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14849

socketTimeout and connectTimeout properties are not getting set via URI Options

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • 2.23.1
    • None
    • camel-http
    • None
    • Unknown

    Description

      HI Team,

      I am having two issue with camel-http producer.

      1. socketTimeout and connectTimeout properties are not getting set via URI Options. And my request is getting timeout after 2mins by default. i have configure the proprties as mentioned in docs https://camel.apache.org/components/latest/http-component.html#_http_component_options

      here is the code which used for producer.

      Tried Code:

      ProducerTemplate template = context.createProducerTemplate();ProducerTemplate template = context.createProducerTemplate(); //context.add String out = template.requestBody("http://tor-virgin-om8-pub:5000/restapi/GetSTBDetails?connectTimeout=1000&socketTimeout=5000", null,String.class); 

       logs:

      ========================================================

      12:15:29.207 [main] DEBUG org.apache.camel.impl.DefaultCamelContext - http://tor-virgin-om8-pub:5000/restapi/GetSTBDetails?connectTimeout=1000&socketTimeout=5000 converted to endpoint: http://tor-virgin-om8-pub:5000/restapi/GetSTBDetails?connectTimeout=1000&socketTimeout=5000 by component: org.apache.camel.component.http.HttpComponent@1e9e725a
      12:15:29.213 [main] DEBUG org.apache.camel.impl.ProducerCache - Adding to producer cache with key: http://tor-virgin-om8-pub:5000/restapi/GetSTBDetails?connectTimeout=1000&socketTimeout=5000 for producer: Producerhttp://tor-virgin-om8-pub:5000/restapi/GetSTBDetails?connectTimeout=1000&socketTimeout=5000
      12:15:29.214 [main] DEBUG org.apache.camel.impl.ProducerCache - >>>> http://tor-virgin-om8-pub:5000/restapi/GetSTBDetails?connectTimeout=1000&socketTimeout=5000 Exchange[]
      12:15:29.237 [main] DEBUG org.apache.camel.component.http.HttpProducer - Executing http GET method: http://tor-virgin-om8-pub:5000/restapi/GetSTBDetails?connectTimeout=1000&socketTimeout=5000
      12:17:47.036 [main] ERROR HttpProducerSOTimeoutTest - Failed=============

      =========================================================

       

       

      2. Http Client is retrying automatically on ConnectException which i dont want, so is there way to disable http client retries?

      Logs:

      INFO  10:24:31 clip-worker-2 connectivity.ConnectivityAdapterRequest>  URL  https://100.10.40.1:9190/test/v1.0/GetSTBDetails?httpMethod=getINFO  10:26:38 clip-worker-2 org.apache.commons.httpclient.HttpMethodDirector> I/O exception (java.net.ConnectException) caught when processing request: Connection timed out (Connection timed out)INFO  10:26:38 clip-worker-2 org.apache.commons.httpclient.HttpMethodDirector> Retrying requestINFO  10:28:45 clip-worker-2 org.apache.commons.httpclient.HttpMethodDirector> I/O exception (java.net.ConnectException) caught when processing request: Connection timed out (Connection timed out)INFO  10:28:45 clip-worker-2 org.apache.commons.httpclient.HttpMethodDirector> Retrying requestINFO  10:30:53 clip-worker-2 org.apache.commons.httpclient.HttpMethodDirector> I/O exception (java.net.ConnectException) caught when processing request: Connection timed out (Connection timed out)INFO  10:30:53 clip-worker-2 org.apache.commons.httpclient.HttpMethodDirector> Retrying request

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            rajesh.pote Rajesh Pote
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: