Skip to content

arminmokri/StreamProcessing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

96 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Stream Processing

Please support this repo with your โญ

This repository provides categorized, real-world examples of stream processing using Java Streams and Kafka Streams.


Java Streams

1. Basic Stream Operations

1- Filter Even Numbers ๐Ÿ”

2- Find First Match ๐Ÿ•ต๏ธ

3- ForEach Print ๐Ÿ–จ๏ธ

4- Distinct Elements ๐Ÿ†”

5- Skip and Limit โญ๏ธ

2. Mapping & FlatMapping

1- Map to Lengths ๐Ÿ—บ๏ธ

3- Parse CSV to Object ๐Ÿ“„

4- Map to Uppercase ๐Ÿ” 

5- FlatMap Optional โ“

3. Reduction & Aggregation

1- Sum Integers โž•

2- Average Salary ๐Ÿ“Š

3- Find Max Salary ๐Ÿ†

4- Count Elements ๐Ÿ”ข

4. Collectors & Conversions

1- Collect To Map ๐Ÿ—บ๏ธ

2- Join Names ๐Ÿ”—

3- Group By Field ๐Ÿงฉ

4- Count Grouped ๐ŸŽญ

5- Collect To Set ๐Ÿงบ

5. Sorting

1- Sort by Salary ๐Ÿ’ธ

2- Multi-field Sort ๐Ÿงฎ

3- Reverse Sort ๐Ÿ”„

5- Sort Custom Objects ๐Ÿ› ๏ธ

6. Advanced Transformations

1- Filter + Map + Reduce ๐Ÿง 

2- Top N Elements ๐Ÿฅ‡

3- Nested Grouping ๐Ÿ—‚๏ธ

7. Parallel Streams

1- Parallel Sum โšก

3- Thread Safety ๐Ÿงต

8. Map Stream Operations

1- Stream over Map Entries ๐Ÿ—ƒ๏ธ

2- Sort Map by Value ๐Ÿ“‰

3- Merge Maps ๐Ÿ”€

4- Filter Map by Key ๐Ÿ”‘

5- Collect Map to List ๐Ÿ“‹

9. Primitive Streams

1- IntStream Range ๐Ÿ”ข

2- Summary Statistics ๐Ÿ“ˆ

3- Boxing/Unboxing ๐Ÿ“ฆ

4- DoubleStream Average ๐ŸŽฏ

5- LongStream Generate ๐Ÿš€

10. Exception Handling

1- Handle ParseException ๐Ÿšซ

2- Safe IO in Stream ๐Ÿงฏ

11. Custom Collectors

12. Real-World Use Cases

4- Top Selling Products ๐Ÿฅ‡

13. Optional Handling

2- Default if Empty ๐Ÿ›ก๏ธ

3- Map Optional Values ๐Ÿ”

4- Filter Optional ๐Ÿ”

5- FlatMap Optional ๐Ÿ”„

14. Debugging with Peek

2- Log in Pipeline ๐Ÿ“

3- Side Effects โš ๏ธ

4- Debug with Thread Info ๐Ÿงต

5- Conditional Peek ๐Ÿ”€

15. Combining Streams

2- Zip Two Lists ๐Ÿงท

4- Intersect Streams โœจ

5- Union Streams ๐Ÿ”—


Kafka Streams

1. Basics

1- Write and Read to Topic โœ๏ธ

2- Word Count ๐Ÿ“Š

4- Stateful Transform ๐Ÿง 

2. Aggregation

1- Group By Key and Count ๐Ÿงฎ

2- Sum Values by Window โฒ๏ธ

3- Custom Aggregator โš™๏ธ

4- Count Per Key ๐Ÿ“ˆ

5- Aggregate to List ๐Ÿ“‹

3. Joins

2- KStream-KTable Join ๐Ÿชข

3- Windowed Joins โณ

4- Left Join ๐Ÿงฉ

5- Outer Join ๐ŸŒ

4. Windowing

1- Tumbling Windows โณ

2- Sliding Windows ๐ŸŽš๏ธ

3- Session Windows ๐Ÿ›‹๏ธ

4- Hopping Windows ๐Ÿ”„

5. Other

1- Branching Streams ๐ŸŒฟ

2- Processor API Way A (PAPI) โš™๏ธ

3- Processor API Way B (PAPI) โš™๏ธ

4- GlobalKTable Join ๐ŸŒ

6. Real-World Use Cases

2- Clickstream Analytics ๐Ÿ–ฑ๏ธ

4- Log Enrichment ๐Ÿงพ

About

StreamProcessing is a collection of practical examples for learning stream processing with Java and Kafka Streams, focused on real tasks like filtering, mapping, aggregation, and event handling.

Topics

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages