Demo code for the Dreamforce 2016 session Analyzing Salesforce Data with Heroku, Kafka, and Connect.
The demo consists of the following parts:
- A script that continuously posts to Salesforce Chatter.
- Apex triggers that send Salesforce Chatter data to a Heroku app using an asynchronous HTTP callout.
- A producer (the Heroku app), which writes a subset of the data to Apache Kafka on Heroku.
- A consumer that reads from Kafka and performs sentiment analysis.
This creates the app that receives REST requests from Salesforce and writes to Kafka.
heroku apps:create MY-APP-NAME
heroku addons:create heroku-kafka:beta-standard-0
heroku plugins:install heroku-kafka
heroku kafka:wait
heroku kafka:topics:create chatter
- Deploy this repo to your app.
- Add the Apex class and triggers from the
apex
directory to your Salesforce org. - Update the endpoint URL in
HerokuPoster.cls
to your Heroku app's URL. - Add your Heroku app's URL to the Remote Site Settings in Salesforce.
See the instructions at https://github.com/alouie-sfdc/chatter-data-pump
This will use the open source TextBlob package to perform sentiment analysis on the Chatter data.
pip install -r requirements.txt
python consumer.py
CTRL-C
to quit