You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by techbird <te...@birdsoft.co.uk> on 2014/06/02 21:00:21 UTC
cxfrs
Hi, two questions if I may.
(1) If I want to invoke REST services, is the cxfrs the preferred
component to use?
(2) Using cxfrs I cannot get throwExceptionOnFailure option to work. I
would like to be able to process errors (>400) in the route, rather than
complicating the code with exceptions. No matter what I try, errors are
always raise an exception. Is there any example code using the option
throwExceptionOnFailure=false?
Best regards, Bird.
Re: cxfrs
Posted by techbird <te...@birdsoft.co.uk>.
Sergey - thank you for your informative, timely and professional
response. I have a great deal of respect for everyone who contributes
into Camel.
Your feedback is really appreciated. Thank you - Bird.
On 03/06/14 20:50, Sergey Beryozkin wrote:
> On 03/06/14 18:56, techbird wrote:
>> Once more thank you Sergey, as discussed jira ticket raised.
>>
>> https://issues.apache.org/jira/browse/CAMEL-7476
> Thanks
>>
>> I guess my hesitation has been caused by coding some simple cxfrs
>> routes; and noticing the behaviour of the producer. I couldn't help but
>> think, if there are lots of developers using cxfrs then this issue would
>> have been resolved a few years ago. So I thought, are developers
>> actually using cxfrs? if not, what component are they using or do
>> developers prefer to use cxf jax-rs directly from a bean or processor.
>>
>
> AFAIK CXFRS definitely has not been the most used Camel HTTP aware
> component. However it has been improved a lot recently. We have it
> supported in our own distro. I also know that some developers do some
> cool things with it but I'm not going to spend time promoting CXFRS here.
>
> The other point: CXFRS, due to its dependency on JAX-RS, does many
> things the non-Camel way. It is a typical compromise: you either do
> various things at a Camel route level, effectively do a route-based
> 'dev' or you have a given component like CXFRS (or CXF) dealing with
> things like serialization, exception handling, etc...
>
> The process of getting CXFRS more Camel friendly is under way, meaning
> that we have some basic improvements in place now for it to respect
> higher-level camel configuration properties, work with Camel-level
> readers/writers, etc.
>
> HTH, Sergey
>
>> For my my use-case, I also have a need for a REST consumer, and for
>> simplicity want use the same component for both producer and consumer.
>> Therefore, I wondered what was the best way to write JAX-RS services in
>> camel!
>>
>> On 03/06/14 09:48, Sergey Beryozkin wrote:
>>> On 03/06/14 07:45, techbird wrote:
>>>> Appreciated Sergey.
>>>>
>>>> You confirmed what I thought, the throwExceptionOnFailure option is
>>>> not
>>>> being processed by the cxfrs component. I'll raise a jira for
>>>> this, and
>>>> also that the default should be false.
>>>>
>>>> Could someone chime in, and let me know if using cxfrs is the wrong
>>>> strategic direction for either invoking or consuming REST services
>>>> (using cxf) with Camel.
>>>
>>> Ultimately it is about making basic HTTP invocations from the route.
>>> So please don't worry about making a 'strategic' mistake by either
>>> using or not using cxfrs. As I said, try one of pure HTTP components.
>>> If you prefer JAX-RS but also for example Jersey rather than CXF then
>>> feel free to do a custom Camel Jersey module. There are many ways to
>>> achieve the goal of doing HTTP requests from the route
>>>
>>> Sergey
>>>
>>>>
>>>> Kind regards and thank you Bird.
>>>>
>>>>
>>>> On 02/06/14 21:11, Sergey Beryozkin wrote:
>>>>> Hi
>>>>>
>>>>> Can you please open a JIRA to get throwExceptionOnFailure=false
>>>>> affecting the client ?
>>>>> I can do it too, we can get it supported in CXFRS
>>>>>
>>>>> Typically, a JAX-RS client dealing with JAX-RS Response should not
>>>>> get
>>>>> the exceptions propagated but I guess it is defaulted to right now in
>>>>> the CXFRS client
>>>>>
>>>>> Cheers, Sergey
>>>>>
>>>>> On 02/06/14 21:05, techbird wrote:
>>>>>> Thanks Sergey - was looking to use jaxrs/cxf. Therefore thought
>>>>>> cxfrs.
>>>>>>
>>>>>> Any ideas about the throwExceptionOnFailure option for cxfrs, has
>>>>>> anyone
>>>>>> being able to get it to work?
>>>>>>
>>>>>> On 02/06/14 20:55, Sergey Beryozkin wrote:
>>>>>>> Hi
>>>>>>> camel jetty, http and restlet and possibly other components can be
>>>>>>> used too
>>>>>>>
>>>>>>> Sergey
>>>>>>> On 02/06/14 20:00, techbird wrote:
>>>>>>>> Hi, two questions if I may.
>>>>>>>>
>>>>>>>> (1) If I want to invoke REST services, is the cxfrs the preferred
>>>>>>>> component to use?
>>>>>>>>
>>>>>>>> (2) Using cxfrs I cannot get throwExceptionOnFailure option to
>>>>>>>> work. I
>>>>>>>> would like to be able to process errors (>400) in the route,
>>>>>>>> rather
>>>>>>>> than
>>>>>>>> complicating the code with exceptions. No matter what I try,
>>>>>>>> errors are
>>>>>>>> always raise an exception. Is there any example code using the
>>>>>>>> option
>>>>>>>> throwExceptionOnFailure=false?
>>>>>>>>
>>>>>>>> Best regards, Bird.
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
Re: cxfrs
Posted by Sergey Beryozkin <sb...@gmail.com>.
On 03/06/14 18:56, techbird wrote:
> Once more thank you Sergey, as discussed jira ticket raised.
>
> https://issues.apache.org/jira/browse/CAMEL-7476
Thanks
>
> I guess my hesitation has been caused by coding some simple cxfrs
> routes; and noticing the behaviour of the producer. I couldn't help but
> think, if there are lots of developers using cxfrs then this issue would
> have been resolved a few years ago. So I thought, are developers
> actually using cxfrs? if not, what component are they using or do
> developers prefer to use cxf jax-rs directly from a bean or processor.
>
AFAIK CXFRS definitely has not been the most used Camel HTTP aware
component. However it has been improved a lot recently. We have it
supported in our own distro. I also know that some developers do some
cool things with it but I'm not going to spend time promoting CXFRS here.
The other point: CXFRS, due to its dependency on JAX-RS, does many
things the non-Camel way. It is a typical compromise: you either do
various things at a Camel route level, effectively do a route-based
'dev' or you have a given component like CXFRS (or CXF) dealing with
things like serialization, exception handling, etc...
The process of getting CXFRS more Camel friendly is under way, meaning
that we have some basic improvements in place now for it to respect
higher-level camel configuration properties, work with Camel-level
readers/writers, etc.
HTH, Sergey
> For my my use-case, I also have a need for a REST consumer, and for
> simplicity want use the same component for both producer and consumer.
> Therefore, I wondered what was the best way to write JAX-RS services in
> camel!
>
> On 03/06/14 09:48, Sergey Beryozkin wrote:
>> On 03/06/14 07:45, techbird wrote:
>>> Appreciated Sergey.
>>>
>>> You confirmed what I thought, the throwExceptionOnFailure option is not
>>> being processed by the cxfrs component. I'll raise a jira for this, and
>>> also that the default should be false.
>>>
>>> Could someone chime in, and let me know if using cxfrs is the wrong
>>> strategic direction for either invoking or consuming REST services
>>> (using cxf) with Camel.
>>
>> Ultimately it is about making basic HTTP invocations from the route.
>> So please don't worry about making a 'strategic' mistake by either
>> using or not using cxfrs. As I said, try one of pure HTTP components.
>> If you prefer JAX-RS but also for example Jersey rather than CXF then
>> feel free to do a custom Camel Jersey module. There are many ways to
>> achieve the goal of doing HTTP requests from the route
>>
>> Sergey
>>
>>>
>>> Kind regards and thank you Bird.
>>>
>>>
>>> On 02/06/14 21:11, Sergey Beryozkin wrote:
>>>> Hi
>>>>
>>>> Can you please open a JIRA to get throwExceptionOnFailure=false
>>>> affecting the client ?
>>>> I can do it too, we can get it supported in CXFRS
>>>>
>>>> Typically, a JAX-RS client dealing with JAX-RS Response should not get
>>>> the exceptions propagated but I guess it is defaulted to right now in
>>>> the CXFRS client
>>>>
>>>> Cheers, Sergey
>>>>
>>>> On 02/06/14 21:05, techbird wrote:
>>>>> Thanks Sergey - was looking to use jaxrs/cxf. Therefore thought
>>>>> cxfrs.
>>>>>
>>>>> Any ideas about the throwExceptionOnFailure option for cxfrs, has
>>>>> anyone
>>>>> being able to get it to work?
>>>>>
>>>>> On 02/06/14 20:55, Sergey Beryozkin wrote:
>>>>>> Hi
>>>>>> camel jetty, http and restlet and possibly other components can be
>>>>>> used too
>>>>>>
>>>>>> Sergey
>>>>>> On 02/06/14 20:00, techbird wrote:
>>>>>>> Hi, two questions if I may.
>>>>>>>
>>>>>>> (1) If I want to invoke REST services, is the cxfrs the preferred
>>>>>>> component to use?
>>>>>>>
>>>>>>> (2) Using cxfrs I cannot get throwExceptionOnFailure option to
>>>>>>> work. I
>>>>>>> would like to be able to process errors (>400) in the route, rather
>>>>>>> than
>>>>>>> complicating the code with exceptions. No matter what I try,
>>>>>>> errors are
>>>>>>> always raise an exception. Is there any example code using the
>>>>>>> option
>>>>>>> throwExceptionOnFailure=false?
>>>>>>>
>>>>>>> Best regards, Bird.
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>>
>
Re: cxfrs
Posted by techbird <te...@birdsoft.co.uk>.
Once more thank you Sergey, as discussed jira ticket raised.
https://issues.apache.org/jira/browse/CAMEL-7476
I guess my hesitation has been caused by coding some simple cxfrs
routes; and noticing the behaviour of the producer. I couldn't help but
think, if there are lots of developers using cxfrs then this issue would
have been resolved a few years ago. So I thought, are developers
actually using cxfrs? if not, what component are they using or do
developers prefer to use cxf jax-rs directly from a bean or processor.
For my my use-case, I also have a need for a REST consumer, and for
simplicity want use the same component for both producer and consumer.
Therefore, I wondered what was the best way to write JAX-RS services in
camel!
On 03/06/14 09:48, Sergey Beryozkin wrote:
> On 03/06/14 07:45, techbird wrote:
>> Appreciated Sergey.
>>
>> You confirmed what I thought, the throwExceptionOnFailure option is not
>> being processed by the cxfrs component. I'll raise a jira for this, and
>> also that the default should be false.
>>
>> Could someone chime in, and let me know if using cxfrs is the wrong
>> strategic direction for either invoking or consuming REST services
>> (using cxf) with Camel.
>
> Ultimately it is about making basic HTTP invocations from the route.
> So please don't worry about making a 'strategic' mistake by either
> using or not using cxfrs. As I said, try one of pure HTTP components.
> If you prefer JAX-RS but also for example Jersey rather than CXF then
> feel free to do a custom Camel Jersey module. There are many ways to
> achieve the goal of doing HTTP requests from the route
>
> Sergey
>
>>
>> Kind regards and thank you Bird.
>>
>>
>> On 02/06/14 21:11, Sergey Beryozkin wrote:
>>> Hi
>>>
>>> Can you please open a JIRA to get throwExceptionOnFailure=false
>>> affecting the client ?
>>> I can do it too, we can get it supported in CXFRS
>>>
>>> Typically, a JAX-RS client dealing with JAX-RS Response should not get
>>> the exceptions propagated but I guess it is defaulted to right now in
>>> the CXFRS client
>>>
>>> Cheers, Sergey
>>>
>>> On 02/06/14 21:05, techbird wrote:
>>>> Thanks Sergey - was looking to use jaxrs/cxf. Therefore thought
>>>> cxfrs.
>>>>
>>>> Any ideas about the throwExceptionOnFailure option for cxfrs, has
>>>> anyone
>>>> being able to get it to work?
>>>>
>>>> On 02/06/14 20:55, Sergey Beryozkin wrote:
>>>>> Hi
>>>>> camel jetty, http and restlet and possibly other components can be
>>>>> used too
>>>>>
>>>>> Sergey
>>>>> On 02/06/14 20:00, techbird wrote:
>>>>>> Hi, two questions if I may.
>>>>>>
>>>>>> (1) If I want to invoke REST services, is the cxfrs the preferred
>>>>>> component to use?
>>>>>>
>>>>>> (2) Using cxfrs I cannot get throwExceptionOnFailure option to
>>>>>> work. I
>>>>>> would like to be able to process errors (>400) in the route, rather
>>>>>> than
>>>>>> complicating the code with exceptions. No matter what I try,
>>>>>> errors are
>>>>>> always raise an exception. Is there any example code using the
>>>>>> option
>>>>>> throwExceptionOnFailure=false?
>>>>>>
>>>>>> Best regards, Bird.
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>
>
Re: cxfrs
Posted by Sergey Beryozkin <sb...@gmail.com>.
On 03/06/14 07:45, techbird wrote:
> Appreciated Sergey.
>
> You confirmed what I thought, the throwExceptionOnFailure option is not
> being processed by the cxfrs component. I'll raise a jira for this, and
> also that the default should be false.
>
> Could someone chime in, and let me know if using cxfrs is the wrong
> strategic direction for either invoking or consuming REST services
> (using cxf) with Camel.
Ultimately it is about making basic HTTP invocations from the route.
So please don't worry about making a 'strategic' mistake by either using
or not using cxfrs. As I said, try one of pure HTTP components.
If you prefer JAX-RS but also for example Jersey rather than CXF then
feel free to do a custom Camel Jersey module. There are many ways to
achieve the goal of doing HTTP requests from the route
Sergey
>
> Kind regards and thank you Bird.
>
>
> On 02/06/14 21:11, Sergey Beryozkin wrote:
>> Hi
>>
>> Can you please open a JIRA to get throwExceptionOnFailure=false
>> affecting the client ?
>> I can do it too, we can get it supported in CXFRS
>>
>> Typically, a JAX-RS client dealing with JAX-RS Response should not get
>> the exceptions propagated but I guess it is defaulted to right now in
>> the CXFRS client
>>
>> Cheers, Sergey
>>
>> On 02/06/14 21:05, techbird wrote:
>>> Thanks Sergey - was looking to use jaxrs/cxf. Therefore thought cxfrs.
>>>
>>> Any ideas about the throwExceptionOnFailure option for cxfrs, has anyone
>>> being able to get it to work?
>>>
>>> On 02/06/14 20:55, Sergey Beryozkin wrote:
>>>> Hi
>>>> camel jetty, http and restlet and possibly other components can be
>>>> used too
>>>>
>>>> Sergey
>>>> On 02/06/14 20:00, techbird wrote:
>>>>> Hi, two questions if I may.
>>>>>
>>>>> (1) If I want to invoke REST services, is the cxfrs the preferred
>>>>> component to use?
>>>>>
>>>>> (2) Using cxfrs I cannot get throwExceptionOnFailure option to
>>>>> work. I
>>>>> would like to be able to process errors (>400) in the route, rather
>>>>> than
>>>>> complicating the code with exceptions. No matter what I try,
>>>>> errors are
>>>>> always raise an exception. Is there any example code using the option
>>>>> throwExceptionOnFailure=false?
>>>>>
>>>>> Best regards, Bird.
>>>>>
>>>>
>>>
>>>
>>
>
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
Re: cxfrs
Posted by techbird <te...@birdsoft.co.uk>.
Appreciated Sergey.
You confirmed what I thought, the throwExceptionOnFailure option is not
being processed by the cxfrs component. I'll raise a jira for this, and
also that the default should be false.
Could someone chime in, and let me know if using cxfrs is the wrong
strategic direction for either invoking or consuming REST services
(using cxf) with Camel.
Kind regards and thank you Bird.
On 02/06/14 21:11, Sergey Beryozkin wrote:
> Hi
>
> Can you please open a JIRA to get throwExceptionOnFailure=false
> affecting the client ?
> I can do it too, we can get it supported in CXFRS
>
> Typically, a JAX-RS client dealing with JAX-RS Response should not get
> the exceptions propagated but I guess it is defaulted to right now in
> the CXFRS client
>
> Cheers, Sergey
>
> On 02/06/14 21:05, techbird wrote:
>> Thanks Sergey - was looking to use jaxrs/cxf. Therefore thought cxfrs.
>>
>> Any ideas about the throwExceptionOnFailure option for cxfrs, has anyone
>> being able to get it to work?
>>
>> On 02/06/14 20:55, Sergey Beryozkin wrote:
>>> Hi
>>> camel jetty, http and restlet and possibly other components can be
>>> used too
>>>
>>> Sergey
>>> On 02/06/14 20:00, techbird wrote:
>>>> Hi, two questions if I may.
>>>>
>>>> (1) If I want to invoke REST services, is the cxfrs the preferred
>>>> component to use?
>>>>
>>>> (2) Using cxfrs I cannot get throwExceptionOnFailure option to
>>>> work. I
>>>> would like to be able to process errors (>400) in the route, rather
>>>> than
>>>> complicating the code with exceptions. No matter what I try,
>>>> errors are
>>>> always raise an exception. Is there any example code using the option
>>>> throwExceptionOnFailure=false?
>>>>
>>>> Best regards, Bird.
>>>>
>>>
>>
>>
>
Re: cxfrs
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
Can you please open a JIRA to get throwExceptionOnFailure=false
affecting the client ?
I can do it too, we can get it supported in CXFRS
Typically, a JAX-RS client dealing with JAX-RS Response should not get
the exceptions propagated but I guess it is defaulted to right now in
the CXFRS client
Cheers, Sergey
On 02/06/14 21:05, techbird wrote:
> Thanks Sergey - was looking to use jaxrs/cxf. Therefore thought cxfrs.
>
> Any ideas about the throwExceptionOnFailure option for cxfrs, has anyone
> being able to get it to work?
>
> On 02/06/14 20:55, Sergey Beryozkin wrote:
>> Hi
>> camel jetty, http and restlet and possibly other components can be
>> used too
>>
>> Sergey
>> On 02/06/14 20:00, techbird wrote:
>>> Hi, two questions if I may.
>>>
>>> (1) If I want to invoke REST services, is the cxfrs the preferred
>>> component to use?
>>>
>>> (2) Using cxfrs I cannot get throwExceptionOnFailure option to work. I
>>> would like to be able to process errors (>400) in the route, rather than
>>> complicating the code with exceptions. No matter what I try, errors are
>>> always raise an exception. Is there any example code using the option
>>> throwExceptionOnFailure=false?
>>>
>>> Best regards, Bird.
>>>
>>
>
>
Re: cxfrs
Posted by techbird <te...@birdsoft.co.uk>.
Thanks Sergey - was looking to use jaxrs/cxf. Therefore thought cxfrs.
Any ideas about the throwExceptionOnFailure option for cxfrs, has anyone
being able to get it to work?
On 02/06/14 20:55, Sergey Beryozkin wrote:
> Hi
> camel jetty, http and restlet and possibly other components can be
> used too
>
> Sergey
> On 02/06/14 20:00, techbird wrote:
>> Hi, two questions if I may.
>>
>> (1) If I want to invoke REST services, is the cxfrs the preferred
>> component to use?
>>
>> (2) Using cxfrs I cannot get throwExceptionOnFailure option to work. I
>> would like to be able to process errors (>400) in the route, rather than
>> complicating the code with exceptions. No matter what I try, errors are
>> always raise an exception. Is there any example code using the option
>> throwExceptionOnFailure=false?
>>
>> Best regards, Bird.
>>
>
Re: cxfrs
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
camel jetty, http and restlet and possibly other components can be used too
Sergey
On 02/06/14 20:00, techbird wrote:
> Hi, two questions if I may.
>
> (1) If I want to invoke REST services, is the cxfrs the preferred
> component to use?
>
> (2) Using cxfrs I cannot get throwExceptionOnFailure option to work. I
> would like to be able to process errors (>400) in the route, rather than
> complicating the code with exceptions. No matter what I try, errors are
> always raise an exception. Is there any example code using the option
> throwExceptionOnFailure=false?
>
> Best regards, Bird.
>