Event destination
When processing events, you can send the results to Kafka topics. This lets the results from the flow be used to trigger automations, notifications, business workflows, or be processed further in other applications.
Scenario: Distributing results of analysis and processing
The EMEA operations team wants to provide a dedicated stream of EMEA order events for further processing, including specific processing for large EMEA orders.
Before you begin
The instructions in this tutorial use the Tutorial environment, which includes a selection of topics each with a live stream of events, created to allow you to explore features in IBM Event Automation. Following the setup instructions to deploy the demo environment gives you a complete instance of IBM Event Automation that you can use to follow this tutorial for yourself.
Versions
This tutorial uses the following versions of Event Automation capabilities. Screenshots may differ from the current interface if you are using a newer version.
- Event Streams 12.0.0
- Event Endpoint Management 11.6.3
- Event Processing 1.4.5
Instructions
Step 1: Create a flow
This tutorial begins with the flow that is created in Identify orders from a specific region.
If you haven’t completed that tutorial yet, you should do it now.
-
Edit the flow title and description to describe the changes that you will make.
Click the flow title in the header bar to open the flow details.
Enter a new title and description and click Save.
Tip: Keep this page open - you will need it again in a moment. Do the following step in a separate browser window or tab.
Step 2: Create the destination Kafka topics
The next step is to create the two Kafka topics that you will use for the results from this flow.
-
Go to the Event Streams home page.
If you need a reminder of how to access the Event Streams web UI, you can review Accessing the tutorial environment.
-
Click the Create a topic tile.
-
Create a topic called
ORDERS.EMEA.You can accept the defaults for the remaining properties of the topic.
-
Click into the new topic page, and then click Connect to this topic.
-
Get the internal address of the Kafka listener to use for the new topic.
Click the Copy icon for the Internal Kafka listener to copy the address to the clipboard.
-
Create another topic called
ORDERS.EMEA.LARGEby using steps 1 to 5. The internal address of the Kafka listener is the same as for theORDERS.EMEAtopic.
Step 3: Provide a destination for EMEA orders results
The next step is to define the event destination for the filtered EMEA orders.
-
Create an Event destination node in the Event Processing flow window.
Create an event destination node by dragging one onto the canvas. You can find this in the Events section of the left panel.
-
Hover over the event destination node and click the Edit icon
to configure the node.
-
Enter
Output EMEA ordersinto the Node name field and paste the internal Kafka listener address copied from Event Streams in Step 2 into the Bootstrap server field. -
Use the username and password for the
kafka-demo-appsuser for accessing the new topic.If you need a reminder of the password for the
kafka-demo-appsuser, you can review the Accessing Kafka topics section of the Tutorial Setup instructions. -
In the Topic selection pane, select the new
ORDERS.EMEAtopic to use as a destination.Click Next.
-
Click Configure to finalize the event destination.
Step 4: Define the filter for the large EMEA orders
The next step is to create the filter that will select the subset of larger EMEA orders.
-
Create a Filter node and link it to the output of the filter EMEA orders.
Create a filter node by dragging one onto the canvas. You can find this in the Processors section of the left panel.
Click and drag from the small gray dot on the the right side of the EMEA orders filter to the matching dot on the left side of new filter node.
Did you know? Instead of dragging the node, you can add a node onto the canvas and automatically connect it to the selected node by double-clicking a node within the palette.
-
Give the filter node a name that describes the events it should identify:
EMEA large orders.Hover over the node and click
Edit to configure the node.
-
Enter the following expression to filter the orders with a total amount larger than 300:
`price` * `quantity` >= 300 -
Click Next to open the Output properties pane. Choose the properties to output.
-
Click Configure to finalize the filter.
Step 5: Provide a destination for EMEA large orders results
The next step is to define the event destination for the filtered EMEA large orders.
- Repeat steps 1-6 under step 3, this time naming the event destination node Output EMEA large orders and selecting the
ORDERS.EMEA.LARGEtopic. The event destination node must be connected to the output of the EMEA orders filter created in the previous step.
Step 6: Test the flow
The final step is to run the flow and confirm that the EMEA orders and EMEA large orders are produced to the new topics.
-
Use the Run menu, and select Include historical to run your filters on the history of order events available in the input topic.
-
Select the Output EMEA orders node and confirm that the events are filtered correctly to only EMEA orders.
-
Confirm that the events for EMEA orders are produced to the new topic
ORDERS.EMEAfrom Event Streams. -
Select the Output EMEA large orders node and confirm that the events are filtered correctly to only EMEA large orders.
-
Confirm that the events for EMEA large orders are produced to the new topic
ORDERS.EMEA.LARGEfrom Event Streams in the same way as for checking theORDERS.EMEAtopic. -
You can leave the flow running to continue producing filtered events to the new topics.
Recap
You output the results of your event processing flow to new Kafka topics.
Next step
In the next tutorial, you will see how to share the results of your event processing flow by adding these new topics to the Event Endpoint Management catalog.
















