You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2013/04/01 10:45:14 UTC

Re: Camel CXF RS: New Simple binding style for JAX-RS

Hi

This seems indeed much better.

It would be great with an example in examples, as well with a web page to
go along. We dont have any REST examples out of the box in Camel.
http://camel.apache.org/examples



On Sun, Mar 31, 2013 at 10:10 PM, Raul Kripalani <ra...@evosent.com> wrote:

> Hi users,
>
> As you may know, Camel has supported JAX-RS under the camel-cxfrs component
> for a long time now.
>
> However, the support has been rather low-level, requiring the user to
> manually process the MessageContentsList object coming into the route. Thus
> tightly coupling the route logic with the method signature and parameter
> indices of the JAX-RS operation. Somewhat inelegant, difficult and
> error-prone.
>
> As of Camel 2.11 (soon to be released), there's a new Simple binding style
> performing with these improvements:
>
>   * JAX-RS Parameters (@HeaderParam, @QueryParam, etc.) are injected as IN
> message headers.
>   * The request entity (POJO or other type) becomes the IN message body.
>   * Binary @Multipart body parts become attachments, supporting
> DataHandler, InputStream, DataSource and CXF's Attachment class.
>   * Non-binary @Multipart body parts are mapped as IN message headers.
>
> The Response mapping has also improved, now recognising custom Responses,
> the Exchange.HTTP_RESPONSE_CODE header, and more.
>
> This binding style can be activated by setting the bindingStyle parameter
> to 'SimpleConsumer'.
>
> Examples and more info here [1]. Or here [2] for the impatient (the Camel
> site takes a while to update from the Wiki).
>
> [1]
>
> http://camel.apache.org/cxfrs.html#CXFRS-ConsumingaRESTRequestSimpleBindingStyle
> [2]
>
> https://cwiki.apache.org/confluence/display/CAMEL/CXFRS#CXFRS-ConsumingaRESTRequestSimpleBindingStyle
>
> Regards,
>
> *Raúl Kripalani*
> Enterprise Architect, Open Source Integration specialist, Program
> Manager | Apache
> Camel Committer
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camel CXF RS: New Simple binding style for JAX-RS

Posted by Martin Stiborský <ma...@gmail.com>.
Hi,
that's really awesome. Thanks a lot. Can't wait to try it out and
incorporate into our project.



On Mon, Apr 1, 2013 at 10:52 AM, Raul Kripalani <ra...@evosent.com> wrote:

> Hi Claus,
>
> Yeah, I plan to add more examples soon. And a blog post is in the pipeline
> too ;)
>
> Thanks,
>
> *Raúl Kripalani*
> Enterprise Architect, Open Source Integration specialist, Program
> Manager | Apache
> Camel Committer
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>
> On Mon, Apr 1, 2013 at 9:45 AM, Claus Ibsen <cl...@gmail.com> wrote:
>
> > Hi
> >
> > This seems indeed much better.
> >
> > It would be great with an example in examples, as well with a web page to
> > go along. We dont have any REST examples out of the box in Camel.
> > http://camel.apache.org/examples
> >
> >
> >
> > On Sun, Mar 31, 2013 at 10:10 PM, Raul Kripalani <ra...@evosent.com>
> wrote:
> >
> > > Hi users,
> > >
> > > As you may know, Camel has supported JAX-RS under the camel-cxfrs
> > component
> > > for a long time now.
> > >
> > > However, the support has been rather low-level, requiring the user to
> > > manually process the MessageContentsList object coming into the route.
> > Thus
> > > tightly coupling the route logic with the method signature and
> parameter
> > > indices of the JAX-RS operation. Somewhat inelegant, difficult and
> > > error-prone.
> > >
> > > As of Camel 2.11 (soon to be released), there's a new Simple binding
> > style
> > > performing with these improvements:
> > >
> > >   * JAX-RS Parameters (@HeaderParam, @QueryParam, etc.) are injected as
> > IN
> > > message headers.
> > >   * The request entity (POJO or other type) becomes the IN message
> body.
> > >   * Binary @Multipart body parts become attachments, supporting
> > > DataHandler, InputStream, DataSource and CXF's Attachment class.
> > >   * Non-binary @Multipart body parts are mapped as IN message headers.
> > >
> > > The Response mapping has also improved, now recognising custom
> Responses,
> > > the Exchange.HTTP_RESPONSE_CODE header, and more.
> > >
> > > This binding style can be activated by setting the bindingStyle
> parameter
> > > to 'SimpleConsumer'.
> > >
> > > Examples and more info here [1]. Or here [2] for the impatient (the
> Camel
> > > site takes a while to update from the Wiki).
> > >
> > > [1]
> > >
> > >
> >
> http://camel.apache.org/cxfrs.html#CXFRS-ConsumingaRESTRequestSimpleBindingStyle
> > > [2]
> > >
> > >
> >
> https://cwiki.apache.org/confluence/display/CAMEL/CXFRS#CXFRS-ConsumingaRESTRequestSimpleBindingStyle
> > >
> > > Regards,
> > >
> > > *Raúl Kripalani*
> > > Enterprise Architect, Open Source Integration specialist, Program
> > > Manager | Apache
> > > Camel Committer
> > > http://about.me/raulkripalani |
> http://www.linkedin.com/in/raulkripalani
> > > http://blog.raulkr.net | twitter: @raulvk
> > >
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > Red Hat, Inc.
> > FuseSource is now part of Red Hat
> > Email: cibsen@redhat.com
> > Web: http://fusesource.com
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
> >
>



-- 
S pozdravem / Best regards
Martin Stiborský

Jabber: stibi@njs.netlab.cz
Twitter: http://www.twitter.com/stibi

Re: Camel CXF RS: New Simple binding style for JAX-RS

Posted by Raul Kripalani <ra...@evosent.com>.
Hi Claus,

Yeah, I plan to add more examples soon. And a blog post is in the pipeline
too ;)

Thanks,

*Raúl Kripalani*
Enterprise Architect, Open Source Integration specialist, Program
Manager | Apache
Camel Committer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Mon, Apr 1, 2013 at 9:45 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> This seems indeed much better.
>
> It would be great with an example in examples, as well with a web page to
> go along. We dont have any REST examples out of the box in Camel.
> http://camel.apache.org/examples
>
>
>
> On Sun, Mar 31, 2013 at 10:10 PM, Raul Kripalani <ra...@evosent.com> wrote:
>
> > Hi users,
> >
> > As you may know, Camel has supported JAX-RS under the camel-cxfrs
> component
> > for a long time now.
> >
> > However, the support has been rather low-level, requiring the user to
> > manually process the MessageContentsList object coming into the route.
> Thus
> > tightly coupling the route logic with the method signature and parameter
> > indices of the JAX-RS operation. Somewhat inelegant, difficult and
> > error-prone.
> >
> > As of Camel 2.11 (soon to be released), there's a new Simple binding
> style
> > performing with these improvements:
> >
> >   * JAX-RS Parameters (@HeaderParam, @QueryParam, etc.) are injected as
> IN
> > message headers.
> >   * The request entity (POJO or other type) becomes the IN message body.
> >   * Binary @Multipart body parts become attachments, supporting
> > DataHandler, InputStream, DataSource and CXF's Attachment class.
> >   * Non-binary @Multipart body parts are mapped as IN message headers.
> >
> > The Response mapping has also improved, now recognising custom Responses,
> > the Exchange.HTTP_RESPONSE_CODE header, and more.
> >
> > This binding style can be activated by setting the bindingStyle parameter
> > to 'SimpleConsumer'.
> >
> > Examples and more info here [1]. Or here [2] for the impatient (the Camel
> > site takes a while to update from the Wiki).
> >
> > [1]
> >
> >
> http://camel.apache.org/cxfrs.html#CXFRS-ConsumingaRESTRequestSimpleBindingStyle
> > [2]
> >
> >
> https://cwiki.apache.org/confluence/display/CAMEL/CXFRS#CXFRS-ConsumingaRESTRequestSimpleBindingStyle
> >
> > Regards,
> >
> > *Raúl Kripalani*
> > Enterprise Architect, Open Source Integration specialist, Program
> > Manager | Apache
> > Camel Committer
> > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> > http://blog.raulkr.net | twitter: @raulvk
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>