confluentinc / confluentinc/examples

Edge case of order validation process in microservices-orders in at-least-once semantics

Open
#1,265 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.1k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

**Description**
In microservices-orders example, we use numbers of validated OrderValidationResult in the topic to validate a order([ref](https://github.com/confluentinc/examples/blob/1aa8434278cdeb17d215b3732851a115287264a1/microservices-orders/src/main/java/io/confluent/examples/streams/microservices/ValidationsAggregatorService.java#L111)) instead of the real rule matching.

It should be okay in the initial [PR](https://github.com/confluentinc/kafka-streams-examples/commit/5921b06fb83fad87b61d26afb46570545e354629#diff-a8b40e93b2829eec9ec9b20603298688ff067e3413cf3133747c77f6e7942a97), which all producers and Kafka Streams are configured in exactly once semantics.
After this [PR](https://github.com/confluentinc/kafka-streams-examples/pull/161) which add confluent interceptors, the processor now run in at least once semantic.

This should cause problem, for example, if we have
* 2 PASS OrderValidationResult from OrderDetailsService
* 1 PASS OrderValidationResult from inventoryService
* 1 FAIL OrderValidationResult from FraudService

We would send two Order with the same order id to the Orders topic, one with FAILED state and the other with VALIDATED state.

**Troubleshooting**
It's hard to reproduce the duplicate event delivery in local environment. All the above description is all from my inference. I am new to Kafka and Kafka Streams, so please kindly correct me if I am wrong.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.