Connect the MuleSoft Database Connector to Heroku Postgres

The MuleSoft Database Connector provides the ability to easily connect to any database as long as you have the JDBC driver. Here’s a quick post/walk-through on how to configure the connector to connect to Heroku Postgres. This post assumes you have a Heroku account with Postgres already added and configured. You also have Anypoint Studio 7.x installed. To start, let’s build a simple Mule flow with the following components:

Example Mule flow
Example Mule flow
You may also like: Mule 4: Database Connector Bulk Insert

The flow will listen for an HTTP request, make a call to Heroku Postgres, and return the data in JSON format. We’ll keep the listener simple and use the defaults, localhost and port 8081. For the path, we’ll use /post so the config looks like the following: