Feasibility of JDBC connectivity from Apigee Edge Using Java Callout Policy

Hello All ,

We would like to run a feasibility study to verify if the below scenario is achievable in Apigee Edge .

We want to build a logic to

  • receive some parameters as part of the API request
  • create a JDBC connection towards a generic database
  • execute a SQL query based on some parameters received in the request
  • retrieve the results
  • elaborate the results and produces a JSON string
  • the JSON is returned as the API response .

So Does Apigee Java Callout Policy allow JDBC call ?

Regards,

Vaibhav

0 4 1,314
4 REPLIES 4

Yes, You can do it, subject to some restrictions.

  1. The Database must be available to the message processor. If you use Apigee Edge SaaS, then the database must be available on the internet. (Which means You should use TLS to connect to it)
  2. You will need to provide the JDBC Driver JAR in the Java resources for your environment or api proxy.
  3. The JDBC driver JAR must not load in any dependencies that are restricted by the MP permissions. You can work around this if you use the on-premises (customer managed) Edge installation.

The Message Processor in Apigee Edge is not designed to be a general-purpose application server. You may wish to run some thin logic in Google App Engine or similar, to handle and manage the JDBC queries.

One nice approach, possibly more attractive to you, is to use the Hosted Functions capability in Apigee Edge, which is available in a pre-release form at this point. It allows you to provide a docker image of a service app that deploys alongside your API Proxy. Within that docker image, you provide your service code, which can be implemented in Java, Python, or nodejs. (And maybe other languages too, in the future). The JDBC connection happens from that node, not directly from the Message Processor.

For more on this contact @Mukundha Madhavan .

@Mukundha Madhavan- Can you please provide sample for how to use to use the Hosted Functions? My requirement is to connect to oracle DB and execute stored procedure and get the output

Hi Muthiah

If you have achieved this , please let me know the steps. I have similar requirement

With the new Apigee architecture, the advice is now, rather than "use Hosted Functions", to just use AppEngine or some other system that is designed to host services or functions.