Understanding EmailService.java in Confluent's microservices-orders example with KSQLDB and Python

Hi people, I was trying to replicate microservice-order example from confluentinc’s example repository -> https://github.com/confluentinc/examples/tree/master/microservices-orders/exercises using python and KSQLDB. Although this example have nice accompanying article, still I am not familiar with Java and that’s why bit confused in EmailService.java’s code. Does this invokes after every new validated order in order topic? Does this also get invoked at every payment? and what is the purpose of having JDBC connector for customer data?

> Does this invokes after every new validated order in order topic
Not exactly. Kafka Streams is consuming that topic, but a new instance of the EmailService class is not created for every event.

Same for payment topic

> purpose of having JDBC connector for customer data
To source data from the database?

https://github.com/confluentinc/examples/blob/master/microservices-orders/docker-compose.yml#L115-L123

Hi ,The invocation part is clear but for customer data, is it good practice to load all of it in streams and query via ksqldb? Between, big fan of yours as every other query of kafka on web have you or as solution author.

Depends on your needs? I personally don’t use ksqlDB. If you need fast, analytical queries, I prefer loading into other databases