This example is to demonstrate and serve as a quick start for how large-scale processing can be moved from Salesforce to Heroku. It consists of four components, each with its own git repository
- Business org: A Salesforce application that keeps track of the activity happening in the Customer org and on Heroku
- Customer org: A Salesforce application that generates Platform Events
- Listener: A Heroku application that consumes events and dispatches them to the worker
- Worker (this project): A Heroku application that receives work from the listener and performs processing on data retrieved from the Customer org
They must be configured in the listed order, due to dependencies (Customer Org and Listener dependent on Business Org and Worker dependent on Listener)
This is an experimental project, which means that:
- It's work in progress
- We need your feedback
- Code contributions are welcome
For more information, please go to the Salesforce Partner Community and view the "Heroku for ISV's - Quick Start" Chatter Group
- Installation
There are two ways to install the Heroku Platform Events Quick Start Heroku worker component:
- Using Heroku CLI
- Using "Deploy to Heroku" button
-
If not already done, get the heroku CLI by following instructions at https://devcenter.heroku.com/articles/heroku-cli
-
From the command line, login to heroku
heroku login
-
Clone this repository:
git clone https://github.com/sfisv-heroku/pe-quickstart-worker cd pe-quickstart-worker
-
Modify the .env file to enter your business org credentials
- Fill in the config variables as follows:
- For LISTENER_APPNAME, enter the App name for the newly created Heroku listener app
- Fill in the config variables as follows:
-
Execute the script to create a new heroku project and set config parameters
./scripts/initHeroku.sh
-
Set the REDIS_URL config variable on the Heroku app:
- Login to the heroku web interface and click on your new app
- Take the REDIS_URL from the last step
- Click on the "Settings" tab
- Click on the "Reveal Config Vars" button
- On a new row, enter REDIS_URL in the box on the left, and the value of REDIS_URL from configuring the Heroku Listener component in the box on the right, and click "Add"
Installing Heroku Platform Events Quick Start Heroku Worker using "Deploy to Heroku" button (Not complete)
Follow the instructions below to deploy your own instance of the application: