I use https://github.com/IBM/event-automation-demo to setup demos that I give using IBM Event Automation. But sometimes it helps to have additional streams of events to use to illustrate other event-driven ideas. This repo contains the setup I am currently using for that.
- Create the default IBM Event Automation demo environment
- Use the instructions here (choose one of the options with persistent storage)
- Seed the Event Endpoint Management catalog
- Use the instructions here
- Modify the Kafka Connect deployment to start adding additional connectors
oc apply -f mqtt-credentials.yaml oc apply -f kafka-connect.yaml
Each of these demos is self-contained. As long as you have the Pre-requisites listed above, you can pick and choose whichever data source(s) you need for a demo that you want to give.
- Create the IBM MQ queue manager
- Use the instructions here
- Create the MQ message schemas
oc apply -f mq-schemas.yaml
- Create the topics
oc apply -f mq-topics.yaml
- Update
kafka-connect.yaml
to un-comment theconnect-schemas-ibmmq
sections in:.spec.template.connectContainer.volumeMounts
.spec.template.pod.volumes
- Apply the updated Kafka Connect spec
oc apply -f kafka-connect.yaml
- Create the connectors
oc apply -f mq-connectors.yaml
- Build the IBM MQ apps
cd apps/ibmmq mvn clean package oc apply -f ocp-build.yaml oc start-build bc/eventautomation-mq-demo-apps -n event-automation --from-file=./target/mq-demo-app-0.0.1-jar-with-dependencies.jar --follow
- Deploy the IBM MQ apps
oc apply -f ocp-deploy.yaml
To demonstrate the source connector:
- the "putter" MQ app is putting XML MQ messages such as this sample to the
IBMMQ.KAFKA
topic - verify the JSON representation of the Kafka message on Event Streams on the
IBMMQ.SOURCE
topic
To demonstrate the sink connector:
- use Event Processing to process the events from the
IBMMQ.SOURCE
topic and output the results to theIBMMQ.SINK
topic - verify the XML representation of the message on the
KAFKA.IBMMQ
IBM MQ queue using the log of the "getter" MQ app
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> IBMMQ.SOURCE
./add-to-catalog.sh <EEM ACCESS TOKEN> IBMMQ.SINK
- Create the topics
oc apply -f mqtt-topics.yaml
- Create the connectors
oc apply -f mqtt-connectors.yaml
To demonstrate the source connector:
- publish MQTT messages to HiveMQ MQTT broker using the
/eventautomation/demo/source
topic - verify Kafka messages on Event Streams on the
MQTT.SOURCE
topic
To demonstrate the sink connector:
- produce JSON Kafka messages to the
MQTT.SINK
topic on Event Streams - verify MQTT messages from HiveMQ MQTT broker using the
/eventautomation/demo/sink
topic
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> MQTT.SOURCE
./add-to-catalog.sh <EEM ACCESS TOKEN> MQTT.SINK
- Create an app password in Bluesky
- Update the
bluesky-credentials.yaml
file, with your username and app password - Create the credentials and topics
oc apply -f bluesky-credentials.yaml oc apply -f bluesky-topics.yaml
- Update
kafka-connect.yaml
to un-comment theconnect-creds-bluesky
sections in:.spec.template.connectContainer.volumeMounts
.spec.template.pod.volumes
- Apply the updated Kafka Connect spec
oc apply -f kafka-connect.yaml
- Create the connectors
oc apply -f bluesky-connectors.yaml
To demonstrate:
- post updates to Bluesky using the word "netflix" or "xbox"
- verify Kafka messages on Event Streams on the
BLUESKY.NETFLIX
orBLUESKY.XBOX
topics
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> BLUESKY.NETFLIX
./add-to-catalog.sh <EEM ACCESS TOKEN> BLUESKY.XBOX
- Create an access token at an instance of Mastodon, including the following scopes
read:statuses
read:search
- Update the
mastodon-credentials.yaml
file, with the access token and the hostname for the instance you chose - Create the credentials and topics
oc apply -f mastodon-credentials.yaml oc apply -f mastodon-topics.yaml
- Update
kafka-connect.yaml
to un-comment theconnect-creds-mastodon
sections in:.spec.template.connectContainer.volumeMounts
.spec.template.pod.volumes
- Apply the updated Kafka Connect spec
oc apply -f kafka-connect.yaml
- Create the connectors
oc apply -f mastodon-connectors.yaml
To demonstrate:
- post updates to Mastodon using the #netflix or #xbox hashtag
- verify Kafka messages on Event Streams on the
MASTODON.NETFLIX
orMASTODON.XBOX
topics
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> MASTODON.NETFLIX
./add-to-catalog.sh <EEM ACCESS TOKEN> MASTODON.XBOX
- Create a free API key
- Update the
stocktrades-credentials.yaml
file - Create the credentials and topics
oc apply -f stocktrades-credentials.yaml oc apply -f stocktrades-topics.yaml
- Update
kafka-connect.yaml
to un-comment theconnect-creds-stocktrades
sections in:.spec.template.connectContainer.volumeMounts
.spec.template.pod.volumes
- Apply the updated Kafka Connect spec
oc apply -f kafka-connect.yaml
- Create the connectors
oc apply -f stocktrades-connectors.yaml
To demonstrate:
- verify Kafka messages on Event Streams on the
STOCKTRADES.IBM
,STOCKTRADES.MICROSOFT
,STOCKTRADES.SALESFORCE
,STOCKTRADES.GOOGLE
topics
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> STOCKTRADES.IBM
./add-to-catalog.sh <EEM ACCESS TOKEN> STOCKTRADES.MICROSOFT
./add-to-catalog.sh <EEM ACCESS TOKEN> STOCKTRADES.SALESFORCE
./add-to-catalog.sh <EEM ACCESS TOKEN> STOCKTRADES.GOOGLE
- Create the topic
oc apply -f wikipedia-topic.yaml
- Create the connectors
oc apply -f wikipedia-connectors.yaml
To demonstrate:
- verify Kafka messages on Event Streams on the
WIKIPEDIA
topic
To add the topic to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> WIKIPEDIA
- Create the PostgreSQL database
- Use the instructions here
- Update
kafka-connect.yaml
to un-comment theconnect-creds-postgresql
andconnect-cert-postgresql
sections in both:.spec.template.connectContainer.volumeMounts
.spec.template.pod.volumes
- Apply the updated Kafka Connect spec
oc apply -f kafka-connect.yaml
- Create the topics
oc apply -f postgresql-topics.yaml
- Create the connector
oc apply -f postgresql-connector.yaml
To demonstrate:
- insert/update/delete rows into the
buildings
orwarehouses
tables in the pgsqldemo database
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> pgsqldemo.public.buildings
./add-to-catalog.sh <EEM ACCESS TOKEN> pgsqldemo.public.warehouses
- Create a free API key
- Update the
weather-credentials.yaml
file - Create the credentials and topics
oc apply -f weather-credentials.yaml oc apply -f weather-topics.yaml
- Update
kafka-connect.yaml
to un-comment theconnect-creds-stocktrades
sections in:.spec.template.connectContainer.volumeMounts
.spec.template.pod.volumes
- Apply the updated Kafka Connect spec
oc apply -f kafka-connect.yaml
- Create the connectors
oc apply -f weather-connectors.yaml
To demonstrate:
- verify Kafka messages on Event Streams on the
WEATHER.HURSLEY
,WEATHER.ARMONK
topics
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> WEATHER.HURSLEY
./add-to-catalog.sh <EEM ACCESS TOKEN> WEATHER.ARMONK
- Create the PostgreSQL database
- Use the instructions here
- Update
kafka-connect.yaml
to un-comment theconnect-creds-postgresql
andconnect-cert-postgresql
sections in both:.spec.template.connectContainer.volumeMounts
.spec.template.pod.volumes
- Apply the updated Kafka Connect spec
oc apply -f kafka-connect.yaml
- Create the topic
oc apply -f pgsqljdbc-topic.yaml
- Create the connector
oc apply -f pgsqljdbc-connector.yaml
To demonstrate:
- send Kafka JSON messages to the
pgsqljdbcsink
topic:
curl \
--silent -k \
-X POST \
-H "Content-Type: application/json" \
--data @pgsqljdbc-message.json \
-u kafka-demo-apps:$(oc get secret kafka-demo-apps -nevent-automation -ojsonpath='{.data.password}' | base64 -d) \
https://$(oc get eventstreams my-kafka-cluster -o jsonpath='{.status.routes.recapi-external}')/topics/pgsqljdbcsink/records > /dev/null
Note: Enable the REST Producer on the Event Streams cluster by adding restProducer: {}
to spec
.
To add the topic to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> pgsqljdbcsink
- Create a free API key
- Update the
xbox-credentials.yaml
file - Create the credentials
oc apply -f xbox-credentials.yaml
- Create the topics
oc apply -f xbox-topics.yaml
- Update
kafka-connect.yaml
to un-comment theconnect-creds-xbox
sections in:.spec.template.connectContainer.volumeMounts
.spec.template.pod.volumes
- Apply the updated Kafka Connect spec
oc apply -f kafka-connect.yaml
- Create the connector
oc apply -f xbox-connector.yaml
To demonstrate:
- verify Kafka messages on Event Streams on the
XBOX.ACHIEVEMENTS
,XBOX.PRESENCE
,XBOX.TEXTPOSTS
,XBOX.USERPOSTS
topics
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> XBOX.ACHIEVEMENTS
./add-to-catalog.sh <EEM ACCESS TOKEN> XBOX.PRESENCE
- Create a free account at https://pipedream.com/requestbin
- Create a Request Bin
- Copy the generated URL for triggering the new HTTP workflow
- Update
restapi-connectors.yaml
to sethttp.url
in.spec.config
to the generated URL - Create the topic
oc apply -f restapi-topic.yaml
- Create the connector
oc apply -f restapi-connectors.yaml
To demonstrate:
- send Kafka JSON messages to the
RESTAPI.SINK
topic:
curl \
--silent -k \
-X POST \
-H "Content-Type: application/json" \
--data @sample-messages/RESTAPI.SINK.json \
-u kafka-demo-apps:$(oc get secret kafka-demo-apps -nevent-automation -ojsonpath='{.data.password}' | base64 -d) \
https://$(oc get eventstreams my-kafka-cluster -o jsonpath='{.status.routes.recapi-external}')/topics/RESTAPI.SINK/records > /dev/null
- verify by viewing the RequestBin - messages will be submitted to the REST API and displayed in the web view
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> RESTAPI.SINK
- Build the API server
cd apps/loosehangerapi ./build.sh
- Deploy the API server to OpenShift
oc apply -f ocp-deploy.yaml
- Access the OpenAPI document for the API
oc get route -n event-automation loosehanger-api -ojsonpath='http://{.status.ingress[0].host}/openapi '
- Access the test interface for the API
oc get route -n event-automation loosehanger-api -ojsonpath='http://{.status.ingress[0].host}/openapi/ui '
blog post explaining the idea behind this
-
Create the topics
oc apply -f transform-topics.yaml
-
Create the connector
oc apply -f transform-connector.yaml
To demonstrate:
- send Kafka XML messages to the
TRANSFORM
topic
<doc>
<temperature>18.4</temperature>
<humidity>37.1</humidity>
</doc>
- verify that a JSON version of the event is on the
TRANSFORM.JSON
topic
{
"temperature": 18.4,
"humidity": 37.1
}
-
Create the topics
oc apply -f bikes-topics.yaml
-
Create the connector
oc apply -f bikes-connector.yaml
To demonstrate:
- verify Kafka messages on Event Streams on the
BIKESHARING.LOCATION
,BIKESHARING.WEATHER
topics
To add the topics to Event Endpoint Management:
./add-to-catalog.sh <EEM ACCESS TOKEN> BIKESHARING.LOCATION
./add-to-catalog.sh <EEM ACCESS TOKEN> BIKESHARING.WEATHER