You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Jason Chaffee <jc...@ebates.com> on 2010/11/07 00:34:26 UTC

Question about jaxrs in ServicMix 4

I would like to use JAXRS as my HTTP endpoint that can handle multiple commands (i.e. PUT/POST/DELETE/GET).   I would like to be able to the request to different endpoints that might read/write data from DIFFERENT databases.  The routing would be done using some EIP based on information passed into the JAXRS request.

Generally, the dao bundle will have the logic for getting/putting data from/to the database and the JAXRS service would use the osgi bundle like an API in the osgi container.

However, I need to be able to use different dao bundles with the same JAXRS service bundle.  Therefore, I am under the impression that I will need to not use like an osgi bundle, but to send a message to the dao bundle and route the messages accordingly. 

My question is what is the best way to do this for a GET, where I need to ask the dao for the data and then return it in the http request?

I was thinking maybe I could do an in/out MEP in the dao where the in would be the request for an operation and out would be the result but I am not sure this is the best or the right way to do this.  I have concerns about the extra overhead that would be incurred to get the data, marshal it to send it as an out message to the JAXRS service, then to be unmarshaled to an object and then to be marshaled again for the response.  

A requirement is that I have a single JAXRS service from the client perspective.

Does anyone have any thoughts or suggestions on the best way to accomplish something like this? 

Thanks in advance.

Jason