Hi
On 05/06/13 17:33, Tarun Kumar wrote:
I am writing restful webservices using camel cxfrs components. I want to
expose > 10 services and my service interface looks like this:

@Path("/employees")
public interface EmployeeService {

@Post
@path("/account")
someMethod1();

@Get
@Path("/books")
someMethod2();
...
...
}

For each endPoint, i don't want to create one cxf:rsServer server (because
it won't be scalable solution). I want to expose all the services with one
cxf:rsServer. So, here is what i did:

<cxf:rsServer id="rsServer" address="http://localhost:8080/employee-service/
"

  serviceClass="com.abc. EmployeeServiceImpl" loggingFeatureEnabled="true"
loggingSizeLimit="20">

</cxf:rsServer>

Route for each service is different. i.e. from().to().to().end() for each
of these services is different. How can i make sure that when i invoke
http://localhost:8080/employee-service/employees/account, route for
someMethod1() should get called?

As far as I understand you may want to have a single cxf:rsServer endpoint which has up to 10 resource classes/beans.
With the regular CXF jaxrs:server, one can do something like this:

<jaxrs:server address="/company">
   <jaxrs:serviceBeans>
      <ref bean="bean1"/>
      <!-- ... -->
      <ref bean="bean10"/>
   </jaxrs:serviceBeans>
</jaxrs:server>

where bean1 to bean10 represent individual root resources, once starting with "/employees", another one with "/managers", etc

I guess you may want to do something like this too with cxf:rsServer
Cheers, Sergey

Reply via email to