Search code examples
tomcatmuleodata

Expose data as an ODATA API using Mule ESB


I am working on a requirement where in we wanted to expose the Oracle data as an ODATA API using Mule ESB.

I was referring to this article below which uses Apache Olingo libraries. This implementation addresses most part of the solution.

I wanted to know how to run this application in Mule ESB using http End point connectors instead of running on Tomcat server.

As I am a beginner to mule ESB, I dont have much idea on how to create reference to web.xml within the mule flow to pass the requests to the servlets.

Any help would be greatly appreciated!

Thanks!


Solution

  • The short answer to your question is that you can't really refer to a web.xml or embeed a standard webapp in a mule server, and even if there is a way I will surely not encourage it.

    Mule can consume ODATA api with the ODATA connector but you cannot really 'create' one in an easy automated way.

    In your case the best approach is probally to create the API using the java library you linked on a dedicated tomact and expose the ODATA APi internally and than proxy it trough mule in a simple pass trough.

    Now is ODATA is just a choice and not a constraint you may rethink this and just expose your Oracle Data as a restFull API using RAML. Off course just remember that mule shouldn't execute any business logic therefore you shouldn't do direct queries but you can call stored procedures/functions that wrap the business logic.

    Hope this helps