camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wheli <>
Subject RE: HTTP POST with ProducerTemplate
Date Mon, 25 Jul 2016 20:38:32 GMT
Ok. I was able to figure this out.

Changed my code to:

Exchange response = template.send(endpoint, new
Integer responseCode =
String responseBody =

And that seems to work. I created a new, local, HttpOutboundProcessor class:

public class HttpOutboundProcessor implements Processor {

    private String exchangeBody;

    public HttpOutboundProcessor(String exchangeBody) {
        this.exchangeBody = exchangeBody;

    public void process(Exchange exchange) throws Exception {
        exchange.getIn().setHeader(Exchange.HTTP_METHOD, "POST");

Thank you for the help.

P.S. I tried replacing the whole exchange in the "process" method, but that
caused issues.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message