API Enrichment in Event Processing

Creating an Apache Flink job using IBM Event Processing that identifies customer retention opportunities

This is a demo of IBM Event Processing that I gave today. The focus was meant to be how API Enrichment (enriching a stream of events with reference data from external sources) can inform the processing of your Flink job, but it ended up being a useful example of filtering and transforming, too.


narrated demo at youtu.be/mzlQZBVg6HA

Scenario

Loosehanger Jeans is a (fictional) clothing retailer. They have a stream of events for cancelled orders: any time a customer cancels an order, there is an event with information about the order and the customer’s reason for cancelling it.

The objective for the event processing flow was to explore how “Loosehanger” could be more responsive to these customers, and identify opportunities to effectively reach out to customers with a more compelling offer.

For this first flow, I focused on orders that were cancelled due to price, where Loosehanger could offer them a custom discount as an incentive to make a new order.

As they wouldn’t want to offer a discount to *everyone* who cancels an order, the role of API Enrichment in this demo was to use data from Loosehanger’s customer loyalty programme to inform the processing that identifies which cancellation events to respond to.

Creating this demo for yourself

Instructions for creating this demo are available at
github.com/dalelane/kafka-demos.

All of this can be deployed into an OpenShift cluster. The setup includes:

  • an Ansible playbook that:
    • creates the Kafka and Flink clusters
    • deploys the Event Automation UI’s
    • starts the data generator that creates random order and order-cancellation events
  • an OpenLiberty implementation of the “customer loyalty” REST API, with the OpenAPI document for the API to allow invoking from Flink

If you’d like to try this for yourself, please let me know if I can help. Playing around with a live stream of events (as you can see me do in the video) is a great way to understand what is possible.

Tags:

Leave a Reply