I don’t always test my streams, but when I do I do it in production August 2020 / Kafka Summit
@gamussa @gamussa
||
@jconf.dev @jconf.dev
||
@confluentinc @confluentinc
Slide 2
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 3
Special thanks
@inponomarev @gamussa
@bsideup |
@jconf.dev
|
@confluentinc
Agenda 01
04
Kafka Apps
Testing Streams
02
05
Testing basics
Testing ksqlDB
03
06
Can we better?
Conclusion
What are those?
TopologyTestDriver vs TestContainers
Run Kafka and CP locally
Ksql-test-runner vs TestContainers
Always Be Testing
Test with TestContainers
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 6
Preface
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 7
Senior Developer: - Where did you get this code? Junior Developer: - From Stackoverflow Senior Developer: - from question or answer? @gamussa
|
@jconf.dev
|
@confluentinc
Slide 8
An example from my life: Kafka Tutorials website
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 9
Literate Programming… Do you speak it… https://en.wikipedia.org/wiki/Literate_programming
@gamussa
|
@jconf.dev
|
@confluentinc
Topology Test driver
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 25
• TopologyTestDriver • Unit test your Kafka Streams Topology • Doesn’t Require Kafka infra to run • Convenience methods to define input and output • Convenience methods to provide fixtures and validate the results
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 26
Let’s see some code
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 27
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 28
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 29
When TTD doesn’t help?
https://gamov.dev/livestreams-s01e05 @gamussa
|
@jconf.dev
|
@confluentinc
Slide 30
Ksqldb for Stream processing @gamussa
|
@jconf.dev
|
@confluentinc
Slide 31
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 32
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 33
Let’s see some code
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 34
Conclusion
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 35
What did you learn today?
• What’s Kafka apps apps and how to test them • Producer / Consumer API • Kafka Streams • ksqlDB • How containers and TestContainer help a lot
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 36
@gamussa
|
@jconf.dev
|
@confluentinc
Slide 37
Want to learn more? @gamussa
|
#springone
|
@confluentinc
Slide 38
Learn Kafka. Start building with Apache Kafka at Confluent Developer. developer.confluent.io
Watch full version https://gamov.dev/developer
Slide 39
Confluent Community Slack
A vibrant community of over 16,000 members Come along and discuss Apache Kafka and Confluent Platform on dedicated channels including #ksqlDB, #connect, #clients, and more
http://cnfl.io/slack
@gamussa
|
@jconf.dev
|
@confluentinc