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

Camel Proxy/Bridge - Premature end of Content-Length delimited message body

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.22.0
    • Fix Version/s: 2.22.0
    • Component/s: camel-http4, camel-undertow
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      I'm using Camel Rest DSL to build endpoints to use as proxies between different networks.

      I have created 2 endpoints. Below the code:

      First:

      restConfiguration().host("localhost").component("undertow").bindingMode(RestBindingMode.off); rest("/endpoint?{1param}&{2param}") .get("/") .route().routeId("Ednpoint1") .autoStartup(true) .setProperty("uri", simple("http4://0.0.0.0:8080/endpoint?1param=${header.1param}&2param=${header.2param}")) .setHeader(Exchange.HTTP_METHOD, constant("GET")) .removeHeaders("CamelHttp*") .toD("${header.uri}").endRest().responseMessage().message("${body}");

       

      Second:

      restConfiguration().host("localhost").component("undertow").bindingMode(RestBindingMode.off); rest("/endpoint?{param1}&{param2}") .get("/") .route().routeId("Endpoint2") .autoStartup(true) .setProperty("uri", simple("http4://endpoint-destionation/service?dhi=${header.param1}&dhf=${header.param2}")) .setHeader(Exchange.HTTP_METHOD, constant("GET")) .removeHeaders("*") .toD("${header.uri}").endRest().responseMessage().message("${body}");

       

      I'm currently getting the following error:

      org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 146541; received: 54482 at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:180) at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137) at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:150) at org.apache.camel.util.IOHelper.copy(IOHelper.java:219) at org.apache.camel.util.IOHelper.copy(IOHelper.java:174) at org.apache.camel.util.IOHelper.copy(IOHelper.java:170) at org.apache.camel.component.http4.HttpProducer.doExtractResponseBodyAsStream(HttpProducer.java:414) at org.apache.camel.component.http4.HttpProducer.extractResponseBody(HttpProducer.java:397) at org.apache.camel.component.http4.HttpProducer.populateResponse(HttpProducer.java:242) at org.apache.camel.component.http4.HttpProducer.process(HttpProducer.java:203) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:178) at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:445) at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:160) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97) at org.apache.camel.component.undertow.UndertowConsumer.handleRequest(UndertowConsumer.java:126) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378) at java.lang.Thread.run(Thread.java:748)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vitorvr Vitor Vianna Ribeiro
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: