You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by gabfssilva <ga...@gmail.com> on 2014/12/16 01:17:35 UTC

Problem with InOnly exchange pattern using with RestDSL

Hello! I'm using spark-java as rest-dsl provider (but I already tried with
the servlet component and still didn't work) and I'm having some issues
using in only in a rest dsl route:

That's the rest configuration:
restConfiguration().component("spark-rest").bindingMode(RestBindingMode.json)
                .dataFormatProperty("prettyPrint", "true");

my endpoint:

       
rest("/rs/tm").consumes(APPLICATION_RESOURCE_JSON).produces(APPLICATION_RESOURCE_JSON)
                .post().outType(Transaction.class).type(Transaction.class)
                        .to("direct:processTransaction");

and, my direct:processTransaction:

 from("direct:processTransaction")
                .process(e -> {
                    //doing really funny stuff over here
                })
                .inOnly("seda:processTransaction");


so... whenever i try to send a message to an endpoint using InOnly exchange
pattern, the rest-dsl endpoint gets messed up, for example, it is not
converted automatically to json before returning to the client, and also
content type is not set, but, when I try to use the InOut pattern,
everything works fine, but I really need this endpoint to be async at that
point.
oh, and yeah, when I don't set the InOnly pattern before calling the seda
endpoint, the message is sent sync, i have no idea why.

does anyone know what could be happening?

waiting for an answer, thanks!!




--
View this message in context: http://camel.465427.n5.nabble.com/Problem-with-InOnly-exchange-pattern-using-with-RestDSL-tp5760717.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Problem with InOnly exchange pattern using with RestDSL

Posted by gabfssilva <ga...@gmail.com>.
Hello! Thanks for answering.

Well, actually it did work! But, I thought that wire tap was not appropriate
for this case. Anyway, do you know why the rest return gets messed up when I
try to send an inOnly message?



--
View this message in context: http://camel.465427.n5.nabble.com/Problem-with-InOnly-exchange-pattern-using-with-RestDSL-tp5760717p5760772.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Problem with InOnly exchange pattern using with RestDSL

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Maybe you should use the wire tap eip

On Tue, Dec 16, 2014 at 1:17 AM, gabfssilva <ga...@gmail.com> wrote:
> Hello! I'm using spark-java as rest-dsl provider (but I already tried with
> the servlet component and still didn't work) and I'm having some issues
> using in only in a rest dsl route:
>
> That's the rest configuration:
> restConfiguration().component("spark-rest").bindingMode(RestBindingMode.json)
>                 .dataFormatProperty("prettyPrint", "true");
>
> my endpoint:
>
>
> rest("/rs/tm").consumes(APPLICATION_RESOURCE_JSON).produces(APPLICATION_RESOURCE_JSON)
>                 .post().outType(Transaction.class).type(Transaction.class)
>                         .to("direct:processTransaction");
>
> and, my direct:processTransaction:
>
>  from("direct:processTransaction")
>                 .process(e -> {
>                     //doing really funny stuff over here
>                 })
>                 .inOnly("seda:processTransaction");
>
>
> so... whenever i try to send a message to an endpoint using InOnly exchange
> pattern, the rest-dsl endpoint gets messed up, for example, it is not
> converted automatically to json before returning to the client, and also
> content type is not set, but, when I try to use the InOut pattern,
> everything works fine, but I really need this endpoint to be async at that
> point.
> oh, and yeah, when I don't set the InOnly pattern before calling the seda
> endpoint, the message is sent sync, i have no idea why.
>
> does anyone know what could be happening?
>
> waiting for an answer, thanks!!
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-with-InOnly-exchange-pattern-using-with-RestDSL-tp5760717.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/