You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Raul Kripalani <ra...@evosent.com> on 2012/12/27 11:08:31 UTC

camel-cxfrs: Handling of Subresources

Hi all,

I have a quick question about the CXF-RS consumers. How are Subresources
and Resource Locators handled?

Does the CXF Binding get invoked each time per Subresource? Or only when
the final resource is hit? If the latter happens, we may have lost a lot of
context, as we never got the chance to process the params, methods, etc.
along the path, only the last ones.

I imagine this question could belong in the CXF forum. After all, I guess
it boils down to: when does CXF invoke the Custom Invoker? But maybe
someone can help...

Regards,

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

Re: camel-cxfrs: Handling of Subresources

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 27/12/12 10:19, Willem jiang wrote:
> Hi Raul
>
> The cxfrs component only hit the final resource. As camel don't know what to do sub resource.
> You can find the code in the performInvocation method of the CxfRsInvoker.
>
One thing I can confirm is that as soon as CXF-level JAX-RS invoker has 
got the control, it will proceed from there and will manage all the 
invocation chain, starting from invoking the root resource method and 
continuing if needed on re-invoking subresource methods - ensuring no 
context is lost

Cheers, Sergey

>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>            http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
>
> On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:
>
>> Hi all,
>>
>> I have a quick question about the CXF-RS consumers. How are Subresources
>> and Resource Locators handled?
>>
>> Does the CXF Binding get invoked each time per Subresource? Or only when
>> the final resource is hit? If the latter happens, we may have lost a lot of
>> context, as we never got the chance to process the params, methods, etc.
>> along the path, only the last ones.
>>
>> I imagine this question could belong in the CXF forum. After all, I guess
>> it boils down to: when does CXF invoke the Custom Invoker? But maybe
>> someone can help...
>>
>> Regards,
>>
>> *Raúl Kripalani*
>> Apache Camel Committer
>> Enterprise Architect, Program Manager, Open Source Integration specialist
>> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
>> http://blog.raulkr.net | twitter: @raulvk<http://twitter.com/raulvk>
>

Re: camel-cxfrs: Handling of Subresources

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 27/12/12 12:07, Raul Kripalani wrote:
> After a detail look in the source code, the issue lies in the Camel
> CxfRsInvoker level. It's no so much of an "issue", but more of a concept
> discussion.
>
> In an ordinary JAX-RS application, the Subresource Locator would use any
> path parameters, query params, etc. when building the resource to return.
> So these parameters are "volatile" and only relevant at that layer. They
> would "perpetuate" as instance variables of the new Resource, probably.
>
> However, with Camel, the user's logic typically executes at the end of the
> resource chain, when the final resource is hit. So as a Camel user, I would
> expect to find all @PathParams, @HeaderParams, @QueryParams, etc. found
> along the way compiled and injected as headers in my IN message (or in a
> MessageContentsList body).
>
> But that doesn't happen. The Camel CxfRsInvoker does indeed invoke the
> Subresource locators (line 52 in 2.10.3), but to cling to the param values
> one would have to write a method body (to "perpetuate" them in some way),
> which is contradictory to the philosophy of camel-cxfrs. The component page
> states: "This class is used to configure the JAXRS properties ONLY. The
> methods will NOT be executed during the routing of messages to the
> endpoint, the route itself is responsible for ALL processing instead.".
> (this is actually inaccurate, because Subresource methods are truly
> executed).
>
Thanks for the above info; IMHO it makes it tricky for users to actually 
utilize CXF JAX-RS implementation, with the cxfrs consumer endpoint - it 
does work but I guess the code required to manually check what to do 
makes the bun of the route code which is not very user centric...

> Anyway, for my use case I will create a custom binding to process
> all org.apache.cxf.jaxrs.model.OperationResourceInfoStack in the CXF
> Exchange, to extract all params and place them as IN message headers. I may
> commit it sooner or later just in case someone else finds it useful ;)
>

Perhaps you might also want to consider using Camel transport and CXF 
jaxrs:endpoint directly, I've prototyped some code recently on this 
list, I only used a caching & delegating JAX-RS MessageBodyWriter to 
cache an immediate response from the endpoint and finally flush it out 
at the end of the route, and with this approach having CXF CustomInvoker 
registered will let tracing all the current parameters, or going 
further, after an upgrade to CXF 2.7.x to use JAX-RS 2.0 
ContainerRequestFilter and UriInfo context to trace all the in-scope 
request parameters...

Cheers, Sergey

> Regards,
>
> *Raúl Kripalani*
> Apache Camel Committer
> Enterprise Architect, Program Manager, Open Source Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk<http://twitter.com/raulvk>
>
> On Thu, Dec 27, 2012 at 10:45 AM, Sergey Beryozkin<sb...@gmail.com>wrote:
>
>> On 27/12/12 10:25, Raul Kripalani wrote:
>>
>>> Hi Willem,
>>>
>>> Thanks for the quick response. Is there an interceptor we can implement to
>>> capture intermediate method invocations?
>>> I found CXF-2709, which is somewhat related. Basically, I'm interested in
>>> exploring all Methods and Param Arrays along the path to the final
>>> resource.
>>>
>>> Right now, if there was a query or path parameter along the way, it
>>> doesn't
>>> appear in the ultimate MessageContentsList.
>>>
>>>
>> If the final resource method, be it part of the sub-resource or root
>> resource, has the parameters annotated as Path or Query parameters, then
>> the final list of parameters should be complete,
>>
>>
>>   If you want we can switch this conversation to the CXF User forum. I
>>> didn't
>>> want to cross-post.
>>>
>>>   Perhaps it's better be discussed at the CXF list indeed, but I wonder,
>> may be I'm misunderstanding the issue :-), and may be the issue belongs at
>> the Camel CXFRsInvoker level ? Can you please prototype some example root&
>> sub resource code - can quickly confirm if it's a CXF level issue or not
>>
>> Cheers, Sergey
>>
>>
>>   Regards,
>>>
>>> *Raúl Kripalani*
>>> Apache Camel Committer
>>> Enterprise Architect, Program Manager, Open Source Integration specialist
>>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>>> raulkripalani<http://www.linkedin.com/in/raulkripalani>
>>> http://blog.raulkr.net | twitter: @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>>>>
>>>
>>> On Thu, Dec 27, 2012 at 10:19 AM, Willem jiang<wi...@gmail.com>**
>>> wrote:
>>>
>>>   Hi Raul
>>>>
>>>> The cxfrs component only hit the final resource. As camel don't know what
>>>> to do sub resource.
>>>> You can find the code in the performInvocation method of the
>>>> CxfRsInvoker.
>>>>
>>>>
>>>> --
>>>> Willem Jiang
>>>>
>>>> Red Hat, Inc.
>>>> FuseSource is now part of Red Hat
>>>> Web: http://www.fusesource.com | http://www.redhat.com
>>>> Blog: http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(
>>>> http://willemjiang.blogspot.**com/<http://willemjiang.blogspot.com/>)
>>>> (English)
>>>>             http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>>>> Twitter: willemjiang
>>>> Weibo: 姜宁willem
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:
>>>>
>>>>   Hi all,
>>>>>
>>>>> I have a quick question about the CXF-RS consumers. How are Subresources
>>>>> and Resource Locators handled?
>>>>>
>>>>> Does the CXF Binding get invoked each time per Subresource? Or only when
>>>>> the final resource is hit? If the latter happens, we may have lost a lot
>>>>>
>>>> of
>>>>
>>>>> context, as we never got the chance to process the params, methods, etc.
>>>>> along the path, only the last ones.
>>>>>
>>>>> I imagine this question could belong in the CXF forum. After all, I
>>>>> guess
>>>>> it boils down to: when does CXF invoke the Custom Invoker? But maybe
>>>>> someone can help...
>>>>>
>>>>> Regards,
>>>>>
>>>>> *Raúl Kripalani*
>>>>> Apache Camel Committer
>>>>> Enterprise Architect, Program Manager, Open Source Integration
>>>>> specialist
>>>>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>>>>> raulkripalani<http://www.linkedin.com/in/raulkripalani>
>>>>> http://blog.raulkr.net | twitter: @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>

Re: camel-cxfrs: Handling of Subresources

Posted by Willem jiang <wi...@gmail.com>.
As the MessageContentsList is put into the message body.
+1 to put the invocation context into the map and put the map into the message header.

But I'm not sure if it is useful if camel-cxfrs delegate the sub resource locator work out side.  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Friday, December 28, 2012 at 7:17 AM, Raul Kripalani wrote:

> Hi,
>  
> Yes, I'm quite happy with CXF-RS, but the MessageContentsList only
> includes the parameters from the final method invoked after following
> the chain of Subresource Locators. Interim parameters are lost.
>  
> Anyway, having to manually process the MessageContentsList is
> inefficient and error-prone. So I ended up creating a custom
> CxfRsBinding to inject all @QueryParams, @PathParams, etc. as IN
> message headers with their original keys. This allows me to place
> XSLTs or subsequent transformations easily.
>  
> To solve the issues with Subresource locators, I process the
> MultivaluedMap in the CXF IN message under the
> URITemplate.TEMPLATE_PARAMETERS key.
>  
> I plan to commit this binding soon for others to use.
>  
> Regards,
> Raúl.
>  
> On 27/12/2012, at 22:34, Jason Chaffee <jchaffee@shopzilla.com (mailto:jchaffee@shopzilla.com)> wrote:
>  
> > I am using camel-cxfrs quite successfully and I am seeing my path and
> > query params in the body, which a MessageContentList. The method
> > parameters are inserted in the order they defined in the method.
> >  
> >  
> > I am using 2.10.3.
> >  
> > Jason
> >  
> >  
> > On 12/27/12 4:07 AM, "Raul Kripalani" <raul@evosent.com (mailto:raul@evosent.com)> wrote:
> >  
> > > After a detail look in the source code, the issue lies in the Camel
> > > CxfRsInvoker level. It's no so much of an "issue", but more of a concept
> > > discussion.
> > >  
> > > In an ordinary JAX-RS application, the Subresource Locator would use any
> > > path parameters, query params, etc. when building the resource to return.
> > > So these parameters are "volatile" and only relevant at that layer. They
> > > would "perpetuate" as instance variables of the new Resource, probably.
> > >  
> > > However, with Camel, the user's logic typically executes at the end of the
> > > resource chain, when the final resource is hit. So as a Camel user, I
> > > would
> > > expect to find all @PathParams, @HeaderParams, @QueryParams, etc. found
> > > along the way compiled and injected as headers in my IN message (or in a
> > > MessageContentsList body).
> > >  
> > > But that doesn't happen. The Camel CxfRsInvoker does indeed invoke the
> > > Subresource locators (line 52 in 2.10.3), but to cling to the param values
> > > one would have to write a method body (to "perpetuate" them in some way),
> > > which is contradictory to the philosophy of camel-cxfrs. The component
> > > page
> > > states: "This class is used to configure the JAXRS properties ONLY. The
> > > methods will NOT be executed during the routing of messages to the
> > > endpoint, the route itself is responsible for ALL processing instead.".
> > > (this is actually inaccurate, because Subresource methods are truly
> > > executed).
> > >  
> > > Anyway, for my use case I will create a custom binding to process
> > > all org.apache.cxf.jaxrs.model.OperationResourceInfoStack in the CXF
> > > Exchange, to extract all params and place them as IN message headers. I
> > > may
> > > commit it sooner or later just in case someone else finds it useful ;)
> > >  
> > > Regards,
> > >  
> > > *Raúl Kripalani*
> > > Apache Camel Committer
> > > Enterprise Architect, Program Manager, Open Source Integration specialist
> > > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> > > http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>
> > >  
> > > On Thu, Dec 27, 2012 at 10:45 AM, Sergey Beryozkin
> > > <sberyozkin@gmail.com (mailto:sberyozkin@gmail.com)>wrote:
> > >  
> > > > On 27/12/12 10:25, Raul Kripalani wrote:
> > > >  
> > > > > Hi Willem,
> > > > >  
> > > > > Thanks for the quick response. Is there an interceptor we can
> > > > > implement to
> > > > > capture intermediate method invocations?
> > > > > I found CXF-2709, which is somewhat related. Basically, I'm interested
> > > > > in
> > > > > exploring all Methods and Param Arrays along the path to the final
> > > > > resource.
> > > > >  
> > > > > Right now, if there was a query or path parameter along the way, it
> > > > > doesn't
> > > > > appear in the ultimate MessageContentsList.
> > > >  
> > > >  
> > > > If the final resource method, be it part of the sub-resource or root
> > > > resource, has the parameters annotated as Path or Query parameters, then
> > > > the final list of parameters should be complete,
> > > >  
> > > >  
> > > > If you want we can switch this conversation to the CXF User forum. I
> > > > > didn't
> > > > > want to cross-post.
> > > > >  
> > > > > Perhaps it's better be discussed at the CXF list indeed, but I wonder,
> > > > may be I'm misunderstanding the issue :-), and may be the issue belongs
> > > > at
> > > > the Camel CXFRsInvoker level ? Can you please prototype some example
> > > > root &
> > > > sub resource code - can quickly confirm if it's a CXF level issue or not
> > > >  
> > > > Cheers, Sergey
> > > >  
> > > >  
> > > > Regards,
> > > > >  
> > > > > *Raúl Kripalani*
> > > > > Apache Camel Committer
> > > > > Enterprise Architect, Program Manager, Open Source Integration
> > > > > specialist
> > > > > http://about.me/raulkripalani | http://www.linkedin.com/in/**
> > > > > raulkripalani <http://www.linkedin.com/in/raulkripalani>
> > > > > http://blog.raulkr.net | twitter:
> > > > > @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
> > > > >  
> > > > >  
> > > > >  
> > > > > On Thu, Dec 27, 2012 at 10:19 AM, Willem
> > > > > jiang<willem.jiang@gmail.com (mailto:willem.jiang@gmail.com)>**
> > > > > wrote:
> > > > >  
> > > > > Hi Raul
> > > > > >  
> > > > > > The cxfrs component only hit the final resource. As camel don't know
> > > > > > what
> > > > > > to do sub resource.
> > > > > > You can find the code in the performInvocation method of the
> > > > > > CxfRsInvoker.
> > > > > >  
> > > > > >  
> > > > > > --
> > > > > > Willem Jiang
> > > > > >  
> > > > > > Red Hat, Inc.
> > > > > > FuseSource is now part of Red Hat
> > > > > > Web: http://www.fusesource.com | http://www.redhat.com
> > > > > > Blog:
> > > > > > http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(
> > > > > > http://willemjiang.blogspot.**com/ <http://willemjiang.blogspot.com/>)
> > > > > > (English)
> > > > > > http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> > > > > > Twitter: willemjiang
> > > > > > Weibo: 姜宁willem
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:
> > > > > >  
> > > > > > Hi all,
> > > > > > >  
> > > > > > > I have a quick question about the CXF-RS consumers. How are
> > > > > > > Subresources
> > > > > > > and Resource Locators handled?
> > > > > > >  
> > > > > > > Does the CXF Binding get invoked each time per Subresource? Or only
> > > > > > > when
> > > > > > > the final resource is hit? If the latter happens, we may have lost a
> > > > > > > lot
> > > > > >  
> > > > > >  
> > > > > > of
> > > > > >  
> > > > > > > context, as we never got the chance to process the params, methods,
> > > > > > > etc.
> > > > > > > along the path, only the last ones.
> > > > > > >  
> > > > > > > I imagine this question could belong in the CXF forum. After all, I
> > > > > > > guess
> > > > > > > it boils down to: when does CXF invoke the Custom Invoker? But maybe
> > > > > > > someone can help...
> > > > > > >  
> > > > > > > Regards,
> > > > > > >  
> > > > > > > *Raúl Kripalani*
> > > > > > > Apache Camel Committer
> > > > > > > Enterprise Architect, Program Manager, Open Source Integration
> > > > > > > specialist
> > > > > > > http://about.me/raulkripalani | http://www.linkedin.com/in/**
> > > > > > > raulkripalani <http://www.linkedin.com/in/raulkripalani>
> > > > > > > http://blog.raulkr.net | twitter:
> > > > > > > @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
>  




Re: camel-cxfrs: Handling of Subresources

Posted by Jason Chaffee <jc...@shopzilla.com>.
Yes, I agree with you on the List.  They should either be Headers, or it
should be Map.  


On 12/27/12 3:17 PM, "Raul Kripalani" <ra...@evosent.com> wrote:

>Hi,
>
>Yes, I'm quite happy with CXF-RS, but the MessageContentsList only
>includes the parameters from the final method invoked after following
>the chain of Subresource Locators. Interim parameters are lost.
>
>Anyway, having to manually process the MessageContentsList is
>inefficient and error-prone. So I ended up creating a custom
>CxfRsBinding to inject all @QueryParams, @PathParams, etc. as IN
>message headers with their original keys. This allows me to place
>XSLTs or subsequent transformations easily.
>
>To solve the issues with Subresource locators, I process the
>MultivaluedMap in the CXF IN message under the
>URITemplate.TEMPLATE_PARAMETERS key.
>
>I plan to commit this binding soon for others to use.
>
>Regards,
>Raúl.
>
>On 27/12/2012, at 22:34, Jason Chaffee <jc...@shopzilla.com> wrote:
>
>> I am using camel-cxfrs quite successfully and I am seeing my path and
>> query params in the body, which a MessageContentList.  The method
>> parameters are inserted in the order they defined in the method.
>>
>>
>> I am using 2.10.3.
>>
>> Jason
>>
>>
>> On 12/27/12 4:07 AM, "Raul Kripalani" <ra...@evosent.com> wrote:
>>
>>> After a detail look in the source code, the issue lies in the Camel
>>> CxfRsInvoker level. It's no so much of an "issue", but more of a
>>>concept
>>> discussion.
>>>
>>> In an ordinary JAX-RS application, the Subresource Locator would use
>>>any
>>> path parameters, query params, etc. when building the resource to
>>>return.
>>> So these parameters are "volatile" and only relevant at that layer.
>>>They
>>> would "perpetuate" as instance variables of the new Resource, probably.
>>>
>>> However, with Camel, the user's logic typically executes at the end of
>>>the
>>> resource chain, when the final resource is hit. So as a Camel user, I
>>> would
>>> expect to find all @PathParams, @HeaderParams, @QueryParams, etc. found
>>> along the way compiled and injected as headers in my IN message (or in
>>>a
>>> MessageContentsList body).
>>>
>>> But that doesn't happen. The Camel CxfRsInvoker does indeed invoke the
>>> Subresource locators (line 52 in 2.10.3), but to cling to the param
>>>values
>>> one would have to write a method body (to "perpetuate" them in some
>>>way),
>>> which is contradictory to the philosophy of camel-cxfrs. The component
>>> page
>>> states: "This class is used to configure the JAXRS properties ONLY. The
>>> methods will NOT be executed during the routing of messages to the
>>> endpoint, the route itself is responsible for ALL processing instead.".
>>> (this is actually inaccurate, because Subresource methods are truly
>>> executed).
>>>
>>> Anyway, for my use case I will create a custom binding to process
>>> all org.apache.cxf.jaxrs.model.OperationResourceInfoStack in the CXF
>>> Exchange, to extract all params and place them as IN message headers. I
>>> may
>>> commit it sooner or later just in case someone else finds it useful ;)
>>>
>>> Regards,
>>>
>>> *Raúl Kripalani*
>>> Apache Camel Committer
>>> Enterprise Architect, Program Manager, Open Source Integration
>>>specialist
>>> http://about.me/raulkripalani |
>>>http://www.linkedin.com/in/raulkripalani
>>> http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>
>>>
>>> On Thu, Dec 27, 2012 at 10:45 AM, Sergey Beryozkin
>>> <sb...@gmail.com>wrote:
>>>
>>>> On 27/12/12 10:25, Raul Kripalani wrote:
>>>>
>>>>> Hi Willem,
>>>>>
>>>>> Thanks for the quick response. Is there an interceptor we can
>>>>> implement to
>>>>> capture intermediate method invocations?
>>>>> I found CXF-2709, which is somewhat related. Basically, I'm
>>>>>interested
>>>>> in
>>>>> exploring all Methods and Param Arrays along the path to the final
>>>>> resource.
>>>>>
>>>>> Right now, if there was a query or path parameter along the way, it
>>>>> doesn't
>>>>> appear in the ultimate MessageContentsList.
>>>>>
>>>>>
>>>> If the final resource method, be it part of the sub-resource or root
>>>> resource, has the parameters annotated as Path or Query parameters,
>>>>then
>>>> the final list of parameters should be complete,
>>>>
>>>>
>>>> If you want we can switch this conversation to the CXF User forum. I
>>>>> didn't
>>>>> want to cross-post.
>>>>>
>>>>> Perhaps it's better be discussed at the CXF list indeed, but I
>>>>>wonder,
>>>> may be I'm misunderstanding the issue :-), and may be the issue
>>>>belongs
>>>> at
>>>> the Camel CXFRsInvoker level ? Can you please prototype some example
>>>> root &
>>>> sub resource code - can quickly confirm if it's a CXF level issue or
>>>>not
>>>>
>>>> Cheers, Sergey
>>>>
>>>>
>>>> Regards,
>>>>>
>>>>> *Raúl Kripalani*
>>>>> Apache Camel Committer
>>>>> Enterprise Architect, Program Manager, Open Source Integration
>>>>> specialist
>>>>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>>>>> raulkripalani <http://www.linkedin.com/in/raulkripalani>
>>>>> http://blog.raulkr.net | twitter:
>>>>> @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>>>>>>
>>>>>
>>>>> On Thu, Dec 27, 2012 at 10:19 AM, Willem
>>>>> jiang<wi...@gmail.com>**
>>>>> wrote:
>>>>>
>>>>> Hi Raul
>>>>>>
>>>>>> The cxfrs component only hit the final resource. As camel don't know
>>>>>> what
>>>>>> to do sub resource.
>>>>>> You can find the code in the performInvocation method of the
>>>>>> CxfRsInvoker.
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Willem Jiang
>>>>>>
>>>>>> Red Hat, Inc.
>>>>>> FuseSource is now part of Red Hat
>>>>>> Web: http://www.fusesource.com | http://www.redhat.com
>>>>>> Blog:
>>>>>> http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(
>>>>>> http://willemjiang.blogspot.**com/
>>>>>><http://willemjiang.blogspot.com/>)
>>>>>> (English)
>>>>>>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>>>>>> Twitter: willemjiang
>>>>>> Weibo: 姜宁willem
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:
>>>>>>
>>>>>> Hi all,
>>>>>>>
>>>>>>> I have a quick question about the CXF-RS consumers. How are
>>>>>>> Subresources
>>>>>>> and Resource Locators handled?
>>>>>>>
>>>>>>> Does the CXF Binding get invoked each time per Subresource? Or only
>>>>>>> when
>>>>>>> the final resource is hit? If the latter happens, we may have lost
>>>>>>>a
>>>>>>> lot
>>>>>>>
>>>>>> of
>>>>>>
>>>>>>> context, as we never got the chance to process the params, methods,
>>>>>>> etc.
>>>>>>> along the path, only the last ones.
>>>>>>>
>>>>>>> I imagine this question could belong in the CXF forum. After all, I
>>>>>>> guess
>>>>>>> it boils down to: when does CXF invoke the Custom Invoker? But
>>>>>>>maybe
>>>>>>> someone can help...
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> *Raúl Kripalani*
>>>>>>> Apache Camel Committer
>>>>>>> Enterprise Architect, Program Manager, Open Source Integration
>>>>>>> specialist
>>>>>>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>>>>>>> raulkripalani <http://www.linkedin.com/in/raulkripalani>
>>>>>>> http://blog.raulkr.net | twitter:
>>>>>>> @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>
>


Re: camel-cxfrs: Handling of Subresources

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

Yes, I'm quite happy with CXF-RS, but the MessageContentsList only
includes the parameters from the final method invoked after following
the chain of Subresource Locators. Interim parameters are lost.

Anyway, having to manually process the MessageContentsList is
inefficient and error-prone. So I ended up creating a custom
CxfRsBinding to inject all @QueryParams, @PathParams, etc. as IN
message headers with their original keys. This allows me to place
XSLTs or subsequent transformations easily.

To solve the issues with Subresource locators, I process the
MultivaluedMap in the CXF IN message under the
URITemplate.TEMPLATE_PARAMETERS key.

I plan to commit this binding soon for others to use.

Regards,
Raúl.

On 27/12/2012, at 22:34, Jason Chaffee <jc...@shopzilla.com> wrote:

> I am using camel-cxfrs quite successfully and I am seeing my path and
> query params in the body, which a MessageContentList.  The method
> parameters are inserted in the order they defined in the method.
>
>
> I am using 2.10.3.
>
> Jason
>
>
> On 12/27/12 4:07 AM, "Raul Kripalani" <ra...@evosent.com> wrote:
>
>> After a detail look in the source code, the issue lies in the Camel
>> CxfRsInvoker level. It's no so much of an "issue", but more of a concept
>> discussion.
>>
>> In an ordinary JAX-RS application, the Subresource Locator would use any
>> path parameters, query params, etc. when building the resource to return.
>> So these parameters are "volatile" and only relevant at that layer. They
>> would "perpetuate" as instance variables of the new Resource, probably.
>>
>> However, with Camel, the user's logic typically executes at the end of the
>> resource chain, when the final resource is hit. So as a Camel user, I
>> would
>> expect to find all @PathParams, @HeaderParams, @QueryParams, etc. found
>> along the way compiled and injected as headers in my IN message (or in a
>> MessageContentsList body).
>>
>> But that doesn't happen. The Camel CxfRsInvoker does indeed invoke the
>> Subresource locators (line 52 in 2.10.3), but to cling to the param values
>> one would have to write a method body (to "perpetuate" them in some way),
>> which is contradictory to the philosophy of camel-cxfrs. The component
>> page
>> states: "This class is used to configure the JAXRS properties ONLY. The
>> methods will NOT be executed during the routing of messages to the
>> endpoint, the route itself is responsible for ALL processing instead.".
>> (this is actually inaccurate, because Subresource methods are truly
>> executed).
>>
>> Anyway, for my use case I will create a custom binding to process
>> all org.apache.cxf.jaxrs.model.OperationResourceInfoStack in the CXF
>> Exchange, to extract all params and place them as IN message headers. I
>> may
>> commit it sooner or later just in case someone else finds it useful ;)
>>
>> Regards,
>>
>> *Raúl Kripalani*
>> Apache Camel Committer
>> Enterprise Architect, Program Manager, Open Source Integration specialist
>> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
>> http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>
>>
>> On Thu, Dec 27, 2012 at 10:45 AM, Sergey Beryozkin
>> <sb...@gmail.com>wrote:
>>
>>> On 27/12/12 10:25, Raul Kripalani wrote:
>>>
>>>> Hi Willem,
>>>>
>>>> Thanks for the quick response. Is there an interceptor we can
>>>> implement to
>>>> capture intermediate method invocations?
>>>> I found CXF-2709, which is somewhat related. Basically, I'm interested
>>>> in
>>>> exploring all Methods and Param Arrays along the path to the final
>>>> resource.
>>>>
>>>> Right now, if there was a query or path parameter along the way, it
>>>> doesn't
>>>> appear in the ultimate MessageContentsList.
>>>>
>>>>
>>> If the final resource method, be it part of the sub-resource or root
>>> resource, has the parameters annotated as Path or Query parameters, then
>>> the final list of parameters should be complete,
>>>
>>>
>>> If you want we can switch this conversation to the CXF User forum. I
>>>> didn't
>>>> want to cross-post.
>>>>
>>>> Perhaps it's better be discussed at the CXF list indeed, but I wonder,
>>> may be I'm misunderstanding the issue :-), and may be the issue belongs
>>> at
>>> the Camel CXFRsInvoker level ? Can you please prototype some example
>>> root &
>>> sub resource code - can quickly confirm if it's a CXF level issue or not
>>>
>>> Cheers, Sergey
>>>
>>>
>>> Regards,
>>>>
>>>> *Raúl Kripalani*
>>>> Apache Camel Committer
>>>> Enterprise Architect, Program Manager, Open Source Integration
>>>> specialist
>>>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>>>> raulkripalani <http://www.linkedin.com/in/raulkripalani>
>>>> http://blog.raulkr.net | twitter:
>>>> @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>>>>>
>>>>
>>>> On Thu, Dec 27, 2012 at 10:19 AM, Willem
>>>> jiang<wi...@gmail.com>**
>>>> wrote:
>>>>
>>>> Hi Raul
>>>>>
>>>>> The cxfrs component only hit the final resource. As camel don't know
>>>>> what
>>>>> to do sub resource.
>>>>> You can find the code in the performInvocation method of the
>>>>> CxfRsInvoker.
>>>>>
>>>>>
>>>>> --
>>>>> Willem Jiang
>>>>>
>>>>> Red Hat, Inc.
>>>>> FuseSource is now part of Red Hat
>>>>> Web: http://www.fusesource.com | http://www.redhat.com
>>>>> Blog:
>>>>> http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(
>>>>> http://willemjiang.blogspot.**com/ <http://willemjiang.blogspot.com/>)
>>>>> (English)
>>>>>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>>>>> Twitter: willemjiang
>>>>> Weibo: 姜宁willem
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:
>>>>>
>>>>> Hi all,
>>>>>>
>>>>>> I have a quick question about the CXF-RS consumers. How are
>>>>>> Subresources
>>>>>> and Resource Locators handled?
>>>>>>
>>>>>> Does the CXF Binding get invoked each time per Subresource? Or only
>>>>>> when
>>>>>> the final resource is hit? If the latter happens, we may have lost a
>>>>>> lot
>>>>>>
>>>>> of
>>>>>
>>>>>> context, as we never got the chance to process the params, methods,
>>>>>> etc.
>>>>>> along the path, only the last ones.
>>>>>>
>>>>>> I imagine this question could belong in the CXF forum. After all, I
>>>>>> guess
>>>>>> it boils down to: when does CXF invoke the Custom Invoker? But maybe
>>>>>> someone can help...
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> *Raúl Kripalani*
>>>>>> Apache Camel Committer
>>>>>> Enterprise Architect, Program Manager, Open Source Integration
>>>>>> specialist
>>>>>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>>>>>> raulkripalani <http://www.linkedin.com/in/raulkripalani>
>>>>>> http://blog.raulkr.net | twitter:
>>>>>> @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>

Re: camel-cxfrs: Handling of Subresources

Posted by Jason Chaffee <jc...@shopzilla.com>.
I am using camel-cxfrs quite successfully and I am seeing my path and
query params in the body, which a MessageContentList.  The method
parameters are inserted in the order they defined in the method.


I am using 2.10.3.

Jason


On 12/27/12 4:07 AM, "Raul Kripalani" <ra...@evosent.com> wrote:

>After a detail look in the source code, the issue lies in the Camel
>CxfRsInvoker level. It's no so much of an "issue", but more of a concept
>discussion.
>
>In an ordinary JAX-RS application, the Subresource Locator would use any
>path parameters, query params, etc. when building the resource to return.
>So these parameters are "volatile" and only relevant at that layer. They
>would "perpetuate" as instance variables of the new Resource, probably.
>
>However, with Camel, the user's logic typically executes at the end of the
>resource chain, when the final resource is hit. So as a Camel user, I
>would
>expect to find all @PathParams, @HeaderParams, @QueryParams, etc. found
>along the way compiled and injected as headers in my IN message (or in a
>MessageContentsList body).
>
>But that doesn't happen. The Camel CxfRsInvoker does indeed invoke the
>Subresource locators (line 52 in 2.10.3), but to cling to the param values
>one would have to write a method body (to "perpetuate" them in some way),
>which is contradictory to the philosophy of camel-cxfrs. The component
>page
>states: "This class is used to configure the JAXRS properties ONLY. The
>methods will NOT be executed during the routing of messages to the
>endpoint, the route itself is responsible for ALL processing instead.".
>(this is actually inaccurate, because Subresource methods are truly
>executed).
>
>Anyway, for my use case I will create a custom binding to process
>all org.apache.cxf.jaxrs.model.OperationResourceInfoStack in the CXF
>Exchange, to extract all params and place them as IN message headers. I
>may
>commit it sooner or later just in case someone else finds it useful ;)
>
>Regards,
>
>*Raúl Kripalani*
>Apache Camel Committer
>Enterprise Architect, Program Manager, Open Source Integration specialist
>http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
>http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>
>
>On Thu, Dec 27, 2012 at 10:45 AM, Sergey Beryozkin
><sb...@gmail.com>wrote:
>
>> On 27/12/12 10:25, Raul Kripalani wrote:
>>
>>> Hi Willem,
>>>
>>> Thanks for the quick response. Is there an interceptor we can
>>>implement to
>>> capture intermediate method invocations?
>>> I found CXF-2709, which is somewhat related. Basically, I'm interested
>>>in
>>> exploring all Methods and Param Arrays along the path to the final
>>> resource.
>>>
>>> Right now, if there was a query or path parameter along the way, it
>>> doesn't
>>> appear in the ultimate MessageContentsList.
>>>
>>>
>> If the final resource method, be it part of the sub-resource or root
>> resource, has the parameters annotated as Path or Query parameters, then
>> the final list of parameters should be complete,
>>
>>
>>  If you want we can switch this conversation to the CXF User forum. I
>>> didn't
>>> want to cross-post.
>>>
>>>  Perhaps it's better be discussed at the CXF list indeed, but I wonder,
>> may be I'm misunderstanding the issue :-), and may be the issue belongs
>>at
>> the Camel CXFRsInvoker level ? Can you please prototype some example
>>root &
>> sub resource code - can quickly confirm if it's a CXF level issue or not
>>
>> Cheers, Sergey
>>
>>
>>  Regards,
>>>
>>> *Raúl Kripalani*
>>> Apache Camel Committer
>>> Enterprise Architect, Program Manager, Open Source Integration
>>>specialist
>>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>>> raulkripalani <http://www.linkedin.com/in/raulkripalani>
>>> http://blog.raulkr.net | twitter:
>>>@raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>>> >
>>>
>>> On Thu, Dec 27, 2012 at 10:19 AM, Willem
>>>jiang<wi...@gmail.com>**
>>> wrote:
>>>
>>>  Hi Raul
>>>>
>>>> The cxfrs component only hit the final resource. As camel don't know
>>>>what
>>>> to do sub resource.
>>>> You can find the code in the performInvocation method of the
>>>> CxfRsInvoker.
>>>>
>>>>
>>>> --
>>>> Willem Jiang
>>>>
>>>> Red Hat, Inc.
>>>> FuseSource is now part of Red Hat
>>>> Web: http://www.fusesource.com | http://www.redhat.com
>>>> Blog: 
>>>>http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(
>>>> http://willemjiang.blogspot.**com/ <http://willemjiang.blogspot.com/>)
>>>> (English)
>>>>            http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>>>> Twitter: willemjiang
>>>> Weibo: 姜宁willem
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:
>>>>
>>>>  Hi all,
>>>>>
>>>>> I have a quick question about the CXF-RS consumers. How are
>>>>>Subresources
>>>>> and Resource Locators handled?
>>>>>
>>>>> Does the CXF Binding get invoked each time per Subresource? Or only
>>>>>when
>>>>> the final resource is hit? If the latter happens, we may have lost a
>>>>>lot
>>>>>
>>>> of
>>>>
>>>>> context, as we never got the chance to process the params, methods,
>>>>>etc.
>>>>> along the path, only the last ones.
>>>>>
>>>>> I imagine this question could belong in the CXF forum. After all, I
>>>>> guess
>>>>> it boils down to: when does CXF invoke the Custom Invoker? But maybe
>>>>> someone can help...
>>>>>
>>>>> Regards,
>>>>>
>>>>> *Raúl Kripalani*
>>>>> Apache Camel Committer
>>>>> Enterprise Architect, Program Manager, Open Source Integration
>>>>> specialist
>>>>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>>>>> raulkripalani <http://www.linkedin.com/in/raulkripalani>
>>>>> http://blog.raulkr.net | twitter:
>>>>>@raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>>>>> >
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>


Re: camel-cxfrs: Handling of Subresources

Posted by Raul Kripalani <ra...@evosent.com>.
After a detail look in the source code, the issue lies in the Camel
CxfRsInvoker level. It's no so much of an "issue", but more of a concept
discussion.

In an ordinary JAX-RS application, the Subresource Locator would use any
path parameters, query params, etc. when building the resource to return.
So these parameters are "volatile" and only relevant at that layer. They
would "perpetuate" as instance variables of the new Resource, probably.

However, with Camel, the user's logic typically executes at the end of the
resource chain, when the final resource is hit. So as a Camel user, I would
expect to find all @PathParams, @HeaderParams, @QueryParams, etc. found
along the way compiled and injected as headers in my IN message (or in a
MessageContentsList body).

But that doesn't happen. The Camel CxfRsInvoker does indeed invoke the
Subresource locators (line 52 in 2.10.3), but to cling to the param values
one would have to write a method body (to "perpetuate" them in some way),
which is contradictory to the philosophy of camel-cxfrs. The component page
states: "This class is used to configure the JAXRS properties ONLY. The
methods will NOT be executed during the routing of messages to the
endpoint, the route itself is responsible for ALL processing instead.".
(this is actually inaccurate, because Subresource methods are truly
executed).

Anyway, for my use case I will create a custom binding to process
all org.apache.cxf.jaxrs.model.OperationResourceInfoStack in the CXF
Exchange, to extract all params and place them as IN message headers. I may
commit it sooner or later just in case someone else finds it useful ;)

Regards,

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

On Thu, Dec 27, 2012 at 10:45 AM, Sergey Beryozkin <sb...@gmail.com>wrote:

> On 27/12/12 10:25, Raul Kripalani wrote:
>
>> Hi Willem,
>>
>> Thanks for the quick response. Is there an interceptor we can implement to
>> capture intermediate method invocations?
>> I found CXF-2709, which is somewhat related. Basically, I'm interested in
>> exploring all Methods and Param Arrays along the path to the final
>> resource.
>>
>> Right now, if there was a query or path parameter along the way, it
>> doesn't
>> appear in the ultimate MessageContentsList.
>>
>>
> If the final resource method, be it part of the sub-resource or root
> resource, has the parameters annotated as Path or Query parameters, then
> the final list of parameters should be complete,
>
>
>  If you want we can switch this conversation to the CXF User forum. I
>> didn't
>> want to cross-post.
>>
>>  Perhaps it's better be discussed at the CXF list indeed, but I wonder,
> may be I'm misunderstanding the issue :-), and may be the issue belongs at
> the Camel CXFRsInvoker level ? Can you please prototype some example root &
> sub resource code - can quickly confirm if it's a CXF level issue or not
>
> Cheers, Sergey
>
>
>  Regards,
>>
>> *Raúl Kripalani*
>> Apache Camel Committer
>> Enterprise Architect, Program Manager, Open Source Integration specialist
>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>> raulkripalani <http://www.linkedin.com/in/raulkripalani>
>> http://blog.raulkr.net | twitter: @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>> >
>>
>> On Thu, Dec 27, 2012 at 10:19 AM, Willem jiang<wi...@gmail.com>**
>> wrote:
>>
>>  Hi Raul
>>>
>>> The cxfrs component only hit the final resource. As camel don't know what
>>> to do sub resource.
>>> You can find the code in the performInvocation method of the
>>> CxfRsInvoker.
>>>
>>>
>>> --
>>> Willem Jiang
>>>
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> Web: http://www.fusesource.com | http://www.redhat.com
>>> Blog: http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(
>>> http://willemjiang.blogspot.**com/ <http://willemjiang.blogspot.com/>)
>>> (English)
>>>            http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>>> Twitter: willemjiang
>>> Weibo: 姜宁willem
>>>
>>>
>>>
>>>
>>>
>>> On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:
>>>
>>>  Hi all,
>>>>
>>>> I have a quick question about the CXF-RS consumers. How are Subresources
>>>> and Resource Locators handled?
>>>>
>>>> Does the CXF Binding get invoked each time per Subresource? Or only when
>>>> the final resource is hit? If the latter happens, we may have lost a lot
>>>>
>>> of
>>>
>>>> context, as we never got the chance to process the params, methods, etc.
>>>> along the path, only the last ones.
>>>>
>>>> I imagine this question could belong in the CXF forum. After all, I
>>>> guess
>>>> it boils down to: when does CXF invoke the Custom Invoker? But maybe
>>>> someone can help...
>>>>
>>>> Regards,
>>>>
>>>> *Raúl Kripalani*
>>>> Apache Camel Committer
>>>> Enterprise Architect, Program Manager, Open Source Integration
>>>> specialist
>>>> http://about.me/raulkripalani | http://www.linkedin.com/in/**
>>>> raulkripalani <http://www.linkedin.com/in/raulkripalani>
>>>> http://blog.raulkr.net | twitter: @raulvk<http://twitter.com/**raulvk<http://twitter.com/raulvk>
>>>> >
>>>>
>>>
>>>
>>>
>>>
>>>
>>
>

Re: camel-cxfrs: Handling of Subresources

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 27/12/12 10:25, Raul Kripalani wrote:
> Hi Willem,
>
> Thanks for the quick response. Is there an interceptor we can implement to
> capture intermediate method invocations?
> I found CXF-2709, which is somewhat related. Basically, I'm interested in
> exploring all Methods and Param Arrays along the path to the final
> resource.
>
> Right now, if there was a query or path parameter along the way, it doesn't
> appear in the ultimate MessageContentsList.
>

If the final resource method, be it part of the sub-resource or root 
resource, has the parameters annotated as Path or Query parameters, then 
the final list of parameters should be complete,

> If you want we can switch this conversation to the CXF User forum. I didn't
> want to cross-post.
>
Perhaps it's better be discussed at the CXF list indeed, but I wonder, 
may be I'm misunderstanding the issue :-), and may be the issue belongs 
at the Camel CXFRsInvoker level ? Can you please prototype some example 
root & sub resource code - can quickly confirm if it's a CXF level issue 
or not

Cheers, Sergey

> Regards,
>
> *Raúl Kripalani*
> Apache Camel Committer
> Enterprise Architect, Program Manager, Open Source Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk<http://twitter.com/raulvk>
>
> On Thu, Dec 27, 2012 at 10:19 AM, Willem jiang<wi...@gmail.com>wrote:
>
>> Hi Raul
>>
>> The cxfrs component only hit the final resource. As camel don't know what
>> to do sub resource.
>> You can find the code in the performInvocation method of the CxfRsInvoker.
>>
>>
>> --
>> Willem Jiang
>>
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Web: http://www.fusesource.com | http://www.redhat.com
>> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
>> (English)
>>            http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>> Twitter: willemjiang
>> Weibo: 姜宁willem
>>
>>
>>
>>
>>
>> On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:
>>
>>> Hi all,
>>>
>>> I have a quick question about the CXF-RS consumers. How are Subresources
>>> and Resource Locators handled?
>>>
>>> Does the CXF Binding get invoked each time per Subresource? Or only when
>>> the final resource is hit? If the latter happens, we may have lost a lot
>> of
>>> context, as we never got the chance to process the params, methods, etc.
>>> along the path, only the last ones.
>>>
>>> I imagine this question could belong in the CXF forum. After all, I guess
>>> it boils down to: when does CXF invoke the Custom Invoker? But maybe
>>> someone can help...
>>>
>>> Regards,
>>>
>>> *Raúl Kripalani*
>>> Apache Camel Committer
>>> Enterprise Architect, Program Manager, Open Source Integration specialist
>>> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
>>> http://blog.raulkr.net | twitter: @raulvk<http://twitter.com/raulvk>
>>
>>
>>
>>
>


Re: camel-cxfrs: Handling of Subresources

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

Thanks for the quick response. Is there an interceptor we can implement to
capture intermediate method invocations?
I found CXF-2709, which is somewhat related. Basically, I'm interested in
exploring all Methods and Param Arrays along the path to the final
resource.

Right now, if there was a query or path parameter along the way, it doesn't
appear in the ultimate MessageContentsList.

If you want we can switch this conversation to the CXF User forum. I didn't
want to cross-post.

Regards,

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

On Thu, Dec 27, 2012 at 10:19 AM, Willem jiang <wi...@gmail.com>wrote:

> Hi Raul
>
> The cxfrs component only hit the final resource. As camel don't know what
> to do sub resource.
> You can find the code in the performInvocation method of the CxfRsInvoker.
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
>
> On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:
>
> > Hi all,
> >
> > I have a quick question about the CXF-RS consumers. How are Subresources
> > and Resource Locators handled?
> >
> > Does the CXF Binding get invoked each time per Subresource? Or only when
> > the final resource is hit? If the latter happens, we may have lost a lot
> of
> > context, as we never got the chance to process the params, methods, etc.
> > along the path, only the last ones.
> >
> > I imagine this question could belong in the CXF forum. After all, I guess
> > it boils down to: when does CXF invoke the Custom Invoker? But maybe
> > someone can help...
> >
> > Regards,
> >
> > *Raúl Kripalani*
> > Apache Camel Committer
> > Enterprise Architect, Program Manager, Open Source Integration specialist
> > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> > http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>
>
>
>
>

Re: camel-cxfrs: Handling of Subresources

Posted by Willem jiang <wi...@gmail.com>.
Hi Raul

The cxfrs component only hit the final resource. As camel don't know what to do sub resource.
You can find the code in the performInvocation method of the CxfRsInvoker.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, December 27, 2012 at 6:08 PM, Raul Kripalani wrote:

> Hi all,
>  
> I have a quick question about the CXF-RS consumers. How are Subresources
> and Resource Locators handled?
>  
> Does the CXF Binding get invoked each time per Subresource? Or only when
> the final resource is hit? If the latter happens, we may have lost a lot of
> context, as we never got the chance to process the params, methods, etc.
> along the path, only the last ones.
>  
> I imagine this question could belong in the CXF forum. After all, I guess
> it boils down to: when does CXF invoke the Custom Invoker? But maybe
> someone can help...
>  
> Regards,
>  
> *Raúl Kripalani*
> Apache Camel Committer
> Enterprise Architect, Program Manager, Open Source Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>