The camel http4 component does not send a body when the http method DELETE is used

Solution Verified - Updated -

Issue

For some reason the camel-http4 component doesn't forward the body when used in conjunction with a DELETE http method. This makes the use of http4 in a proxy configuration for a REST service more or less impossible.

Example proxy route: the body of a delete is not send to the second route:

     <camelContext id="http-delete" trace="true" xmlns="http://camel.apache.org/schema/blueprint">
        <route id="proxy">
            <from id="source" uri="jetty:http://localhost:9999?matchOnUriPrefix=true"/>
            <setHeader headerName="CamelHttpMethod">
                <constant>DELETE</constant>
            </setHeader>
            <setBody>
                <constant>this should be sent to the second route</constant>
            </setBody>
            <to id="destination" uri="http4://localhost:9998?bridgeEndpoint=true&amp;throwExceptionOnFailure=false"/>
        </route>
        <route id="proxy2">
            <from id="source2" uri="jetty:http://localhost:9998?matchOnUriPrefix=true"/>
            <to id="destination2" uri="log:result"/>
        </route>
    </camelContext>

Environment

  • Red Hat JBoss Fuse
    • 6.3.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.