Fluxtion examples¶
A practical, copy‑and‑run catalog of small examples that show how to build high‑performance, type‑safe, event‑driven DataFlows with Fluxtion.
Fluxtion example repo¶
Fluxtion lets you compose real‑time streaming logic as declarative DataFlows. You connect sources, transformations, joins, windows, and sinks into an efficient runtime graph and push events through it with minimal overhead.
Why these examples exist¶
- Give you a fast feel for the DataFlow API (minutes, not hours)
- Demonstrate the core patterns you’ll actually use: map/filter, groupBy, joins, windows, triggers, sinks
- Provide copy‑pasteable snippets you can adapt into your own project
- Offer a gentle path from a tiny hello‑world to feature‑focused “cookbook” samples
Who this is for¶
- Java developers building event processing, streaming analytics, or stateful, low‑latency services
- Anyone exploring whether Fluxtion fits their problem (e.g., replacing ad‑hoc listeners with a clear dataflow)
If you’re new to Fluxtion, start with the getting‑started examples, then dip into the reference (cookbook) when you need one feature in isolation.
Getting Started git repo¶
Quick introductions and progressive tutorials that build intuition fast. This module contains simple, self‑contained examples to help you learn Fluxtion’s DataFlow API quickly. Start here if you’re new: run a tiny hello‑world flow, then explore short snippets for windowing, triggers, and multi‑feed joins. A tutorial series (Part 1–5) builds concepts step by step.
- Hello, Fluxtion: the minimal subscribe → map → print: HelloFluxtion.java
- Quickstart: average speed by make with sliding window (groupBy + windowing): GroupByWindowExample.java
- Front‑page snippets
- Windowing: WindowExample.java
- Triggering: TriggerExample.java
- Multi‑join: MultiFeedJoinExample.java
- Tutorials (progressive walkthrough)
- TutorialPart1 — Basics: build a tiny flow to compute per-symbol running net quantity.
- TutorialPart2 — Sliding windows: per-symbol rolling average with thresholded alerts.
- TutorialPart3 — Mix DSL with an imperative stateful node and lifecycle callbacks.
- TutorialPart4 — Embed a DataFlow in a HTTP microservice.
- TutorialPart5 — Wire file feeds and sinks: read from a file, transform, and write to a file.
Reference git repo¶
This module is a cookbook of small, focused samples that each demonstrate one Fluxtion feature in isolation. Browse by area (functional ops, group-by, windowing, triggers, nodes, event feeds) and open the corresponding Java file. All samples are runnable from your IDE (look for a public static void main)
Functional building blocks¶
- Map: MapSample.java
- Filter: FilterSample.java
- FlatMap: FlatMapSample.java
- Merge: MergeSample.java
- Merge and map: MergeAndMapSample.java
- Default value: DefaultValueSample.java
- Bi-map: BiMapSample.java
- Re‑entrant events: ReEntrantEventSample.java
- Subscribe to event: SubscribeToEventSample.java
- Reset function: ResetFunctionSample.java
- Sink: SinkExample.java
- Get node by id: GetFlowNodeByIdExample.java
Grouping and joins¶
- Basic groupBy: GroupBySample.java
- Group by specific fields: GroupByFieldsSample.java
- Group by map key: GroupByMapKeySample.java
- Group by map values: GroupByMapValuesSample.java
- Reduce grouped values: GroupByReduceSample.java
- To list: GroupByToListSample.java
- To set: GroupByToSetSample.java
- Inner join: GroupByJoinSample.java
- Left outer join: GroupByLeftOuterJoinSample.java
- Right outer join: GroupByRightOuterJoinSample.java
- Full outer join: GroupByFullOuterJoinSample.java
- Multi‑join: MultiJoinSample.java
- Sliding groupBy: SlidingGroupBySample.java
- Sliding groupBy (compound key): SlidingGroupByCompoundKeySample.java
- Tumbling groupBy: TumblingGroupBySample.java
- Tumbling groupBy (compound key): TumblingGroupByCompoundKeySample.java
- Delete group entries: GroupByDeleteSample.java
Windowing and triggers¶
- Sliding window: SlidingWindowSample.java
- Tumbling window: TumblingWindowSample.java
- Tumbling window with trigger: TumblingTriggerSample.java
Triggers¶
- Update trigger: TriggerUpdateSample.java
- Publish trigger: TriggerPublishSample.java
- Reset trigger: TriggerResetSample.java
- Publish override: TriggerPublishOverrideSample.java
Working with nodes¶
- Wrap functions: WrapFunctionsSample.java
- Subscribe to node: SubscribeToNodeSample.java
- Push pattern: PushSample.java
- Map from node property: MapFromNodePropertySample.java
- Member variable supplier: FlowSupplierAsMemberVariableSample.java
Imperative node examples¶
Subscribe¶
- Multiple event types: MultipleEventTypes.java
- Unknown event handling: UnknownEventHandling.java
- Wrap node: WrapNode.java
Filtering¶
- Static filtering: StaticFiltering.java
- Variable filtering: VariableFiltering.java
Callbacks¶
- After event callback: AfterEventCallback.java
- After trigger callback: AfterTriggerCallback.java
- Lifecycle callback: LifecycleCallback.java
Triggering¶
- Conditional trigger children: ConditionalTriggerChildren.java
- Identify trigger parent: IdentifyTriggerParent.java
- Identify trigger parent by id: IdentifyTriggerParentById.java
- Push trigger: PushTrigger.java
- Trigger children: TriggerChildren.java
Trigger overrides¶
- Invert dirty trigger: InvertDirtyTrigger.java
- No-propagate handler: NoPropagateHandler.java
- Single trigger override: SingleTriggerOverride.java
Advanced¶
- Batch support: BatchSupport.java
- Collection support: CollectionSupport.java
- Fork/join support: ForkJoinSupport.java
Event feeds and runners¶
- Data flow runner (file feed): DataFlowRunnerSample.java
Prerequisites¶
- Java 21+ (examples include headers for newer JDKs and work on current LTS)
- Maven 3.9+
- jbang
Learn more¶
Contributing / feedback¶
Please open issues in the Fluxtion repository for questions, ideas, or any problems you find while using these examples.