You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by karthik Subramanian <ka...@gmail.com> on 2016/07/18 19:23:34 UTC

Camel HTTP response body is empty though the exchange body has the payload

rest("/getOptChoice").
        get("/v1")
        .consumes("application/json")
        .to("direct:hello")
        .produces("application/json");

from("direct:hello")
        .split(header("emails"))
        .to("seda:consumeGuestChoice")
        .aggregate(constant(true),new OptAggregator())
        .completionSize(2)
        .marshal(jaxb)
        .convertBodyTo(String.class);
After converting the body, if i do print the exchange body, i see the
payload. But the HTTP response from the rest service is always empty.

Has someone faced this issue before? If so, is there a work-around?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-HTTP-response-body-is-empty-though-the-exchange-body-has-the-payload-tp5785217.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel HTTP response body is empty though the exchange body has the payload

Posted by Claus Ibsen <cl...@gmail.com>.
The aggregator is running in another "leg" than your message. So the
output of the aggregator runs separated from the messages that routes
into the aggregator.




On Mon, Jul 18, 2016 at 9:23 PM, karthik Subramanian
<ka...@gmail.com> wrote:
> rest("/getOptChoice").
>         get("/v1")
>         .consumes("application/json")
>         .to("direct:hello")
>         .produces("application/json");
>
> from("direct:hello")
>         .split(header("emails"))
>         .to("seda:consumeGuestChoice")
>         .aggregate(constant(true),new OptAggregator())
>         .completionSize(2)
>         .marshal(jaxb)
>         .convertBodyTo(String.class);
> After converting the body, if i do print the exchange body, i see the
> payload. But the HTTP response from the rest service is always empty.
>
> Has someone faced this issue before? If so, is there a work-around?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-HTTP-response-body-is-empty-though-the-exchange-body-has-the-payload-tp5785217.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Camel HTTP response body is empty though the exchange body has the payload

Posted by souciance <so...@gmail.com>.
Did you also set the ExchangePattern to InOut?

On Tue, Jul 19, 2016 at 2:33 AM, karthik Subramanian [via Camel] <
ml-node+s465427n5785221h14@n5.nabble.com> wrote:

> I did try setting the body in the out component of the exchange. But still
> the HTTP response is empty.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-HTTP-response-body-is-empty-though-the-exchange-body-has-the-payload-tp5785217p5785221.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-HTTP-response-body-is-empty-though-the-exchange-body-has-the-payload-tp5785217p5785223.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel HTTP response body is empty though the exchange body has the payload

Posted by karthik Subramanian <ka...@gmail.com>.
I did try setting the body in the out component of the exchange. But still
the HTTP response is empty.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-HTTP-response-body-is-empty-though-the-exchange-body-has-the-payload-tp5785217p5785221.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel HTTP response body is empty though the exchange body has the payload

Posted by souciance <so...@gmail.com>.
Try setting the reponse in the Out exchange.

On Mon, Jul 18, 2016 at 9:23 PM, karthik Subramanian [via Camel] <
ml-node+s465427n5785217h90@n5.nabble.com> wrote:

> rest("/getOptChoice").
>         get("/v1")
>         .consumes("application/json")
>         .to("direct:hello")
>         .produces("application/json");
>
> from("direct:hello")
>         .split(header("emails"))
>         .to("seda:consumeGuestChoice")
>         .aggregate(constant(true),new OptAggregator())
>         .completionSize(2)
>         .marshal(jaxb)
>         .convertBodyTo(String.class);
> After converting the body, if i do print the exchange body, i see the
> payload. But the HTTP response from the rest service is always empty.
>
> Has someone faced this issue before? If so, is there a work-around?
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-HTTP-response-body-is-empty-though-the-exchange-body-has-the-payload-tp5785217.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-HTTP-response-body-is-empty-though-the-exchange-body-has-the-payload-tp5785217p5785220.html
Sent from the Camel - Users mailing list archive at Nabble.com.