Sliding window analytical use case

Prerequisites

Revisit the use case building framework to get an understanding on how to create a use case out of business context.

Revisit low code development to get an understanding on what is the anatomy of a use case.

Overview

This use case builds upon the first use case with the additional

These instructions should only be used to configure the Joule Platform for development or demonstration purposes.

Use case definition

Filtered stream of Nasdaq major bank quotes

Overview of use case processing sequence
1

Use case objective

Provide trading consumer application for the current business day with bid and ask quotes and company information for all major banks with a market cap of over $350 billion trading on the nasdaq stock market and when the spread widens to over 1.5%.

The use case should only be processing for a single defined market business day.

2

Processing steps

  1. Enrich events with industry and market cap context information

  2. Filter events by 'Major Banks' industry and with market cap greater than $350 billion

  3. Send a stock record with following attributes for every event; symbol, company_name, market_cap, bid, ask

Stream definition

3

Data sources

Subscribe to live nasdaq quote data (note we are using simulated data)

Source definition

4

Validate output

A quick and easy way to validate your use case processing is to send the resulting events to a CSV file.

The use case will output both to a Kafka topic and CSV file using the current configuration.

5

Publish events to consumers

Once you are satisfied with the results its time to switch to publishing events on to the Kafka consumer topic.

A quick recap of how events will be transformed to AVRO data structures:

  1. The user emit projection is rransformed to provided domain data type using an AVRO schema, see below.

  2. The resulting events are then published on to the nasdaq_major_bank_quotes Kafka topic.

AVRO schema

6

Sink definition

7

Deploying the use case

Now we have the use case definition we can now deployable the definitions to Joule. Following the same getting started deployment steps for this project.

Go to the "Build your first use case" folder under the Joule - Banking demo / Tutorials Postman examples within the getting started project

8

Reviewing results

First take a look at the generated CSV file by getting the first six lines of the file:

The command should return output similar to the below:

What we have learnt

As a first use case we have covered a number of key features:

  • Subscribe and consume events Subscribe, consume, parse and present events ready for pipeline processing using Kafka.

  • Initialise Joule with contextual data Load local CSV contextual data in to the JouleDB

  • Filters and enrichment Apply filter for a subset of events using Javascript expressions and apply event enrichment with company data loaded in to JouleDB

  • Results filter expression Using the "having" clause with a Javascript expression to only send events based upon a spread ratio breach

  • Publishing events Send processed events to either a CSV file or on to a Kafka topic as a defined AVRO domain data structure

Last updated