Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-11066

camel http4 exception with empty body

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • fuse-7.5-ER1
    • None
    • Camel
    • None
    • % %
    • +
    • Hide

      An example route for the http4 producer is:

      from("direct:processRequest")
                              .setHeader(Exchange.HTTP_METHOD, constant("DELETE"))
                              .removeHeader(Exchange.HTTP_PATH)
                              .to("http4://localhost:9000/cursos/1?bridgeEndpoint=true")
                              .log("${body}");
      

      If you manipulate the exchange body prior to producing to the http4 endpoint, the exception is not thrown. For example

      from("direct:processRequest")
                              .setHeader(Exchange.HTTP_METHOD, constant("DELETE"))
                              .removeHeader(Exchange.HTTP_PATH)
                              .setBody(constant("")) //workaround for null body and http4 component
                              .to("http4://localhost:9000/cursos/1?bridgeEndpoint=true")
                              .log("${body}");
      
      Show
      An example route for the http4 producer is: from( "direct:processRequest" ) .setHeader(Exchange.HTTP_METHOD, constant( "DELETE" )) .removeHeader(Exchange.HTTP_PATH) .to( "http4: //localhost:9000/cursos/1?bridgeEndpoint= true " ) .log( "${body}" ); If you manipulate the exchange body prior to producing to the http4 endpoint, the exception is not thrown. For example from( "direct:processRequest" ) .setHeader(Exchange.HTTP_METHOD, constant( "DELETE" )) .removeHeader(Exchange.HTTP_PATH) .setBody(constant("")) //workaround for null body and http4 component .to( "http4: //localhost:9000/cursos/1?bridgeEndpoint= true " ) .log( "${body}" );
    • Fuse 7.5 Sprint 52 - Bug fix

      With a http4 producer that invokes a rest web service that returns an expected status of 204 "No Content" and no response body, the http4 producer throws:

      org.apache.camel.RuntimeCamelException: java.io.IOException: Stream closed
      	at org.apache.camel.http.common.HttpMessage.createBody(HttpMessage.java:80)
      	at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:54)
      	at org.apache.camel.builder.ExpressionBuilder$35.evaluate(ExpressionBuilder.java:905)
      	at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36)
      	at org.apache.camel.processor.LogProcessor.process(LogProcessor.java:64)
      	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
      

            rhn-support-tasato Tadayoshi Sato
            rhn-support-shiggs Stephen Higgs
            Jan Bouska Jan Bouska
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: