In this example, we'll import the regex
crate to demonstrate adding external dependencies
for inline functions. We'll use the regex function to identify generation-z based on their year of birth.
- Checkout the dataflow.yaml.
- Make sure to Install SDF and start a Fluvio cluster.
With the dataflow.yaml
file in the current directory, run the following commands:
sdf run
Produce records in the person
topic:
fluvio produce person
{"name": "John", "born": 1996}
{"name": "Alice", "born": 1998}
{"name": "Bob", "born": 2011}
{"name": "Michael", "born": 2018}
Consume from gen-z
to retrieve the result:
fluvio consume gen-z -Bd
{"name": "Alice", "born": 1998}
{"name": "Bob", "born": 2011}
Exit sdf
terminal and remove the topics:
fluvio topic delete person
fluvio topic delete gen-z