[
https://issues.apache.org/jira/browse/CAMEL-8205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14275164#comment-14275164
]
Sergey Beryozkin commented on CAMEL-8205:
-----------------------------------------
Hi Willem
I'm thinking a bit more about it, may be this test should not go yet into the
test source because it is very ineffective to do it this way. This is what I've
tested:
{code:xml}
<cxf:rsServer id="rsServer3"
address="http://localhost:${CXFTestSupport.port1}/CxfRsSpringConsumerTest3/">
<cxf:serviceBeans>
<ref bean="customerServiceBean"/>
</cxf:serviceBeans>
</cxf:rsServer>
<bean id="customerServiceBean"
class="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"/>
{code}
and then
{code:java}
protected RouteBuilder createRouteBuilder() throws Exception {
final Processor baseUriProcessor = new Processor() {
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader("CamelHttpBaseUri",
"/CxfRsSpringConsumerTest3");
}
};
return new RouteBuilder() {
public void configure() {
from("cxfrs://bean://rsServer3").process(baseUriProcessor)
.to("cxfbean:customerServiceBean");
}
};
}
{code}
This actually works right now, the problem is the CXF server chain is run
twice. The existing example where a Jetty consumer delegates to a cxfbean is
more effective.
I'm still considering to attach this test as part of a patch but for a
different issue (a JAX-RS out interceptor can initiate a route to process a
response). For this issue I'd like to have something like
{code:java}
protected RouteBuilder createRouteBuilder() throws Exception {
final Processor customerProcessor = new Processor() {
public void process(Exchange exchange) throws Exception {
exchange.getIn().getBody(Customer.class).setId(999);
}
};
return new RouteBuilder() {
public void configure() {
from("cxfrs://bean://rsServer3").process(customerProcessor);
}
};
}
{code}
but I'm not sure how viable it is; I'll experiment a bit later on
Thanks
> CXFRS Server should be able to invoke on JAX-RS service implementations
> ------------------------------------------------------------------------
>
> Key: CAMEL-8205
> URL: https://issues.apache.org/jira/browse/CAMEL-8205
> Project: Camel
> Issue Type: Improvement
> Components: camel-cxf
> Reporter: Sergey Beryozkin
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)