Comments on: Deep Dive into Saga Transactions with Kafka Streams and Spring Boot https://piotrminkowski.com/2022/02/07/deep-dive-into-saga-transactions-with-kafka-streams-and-spring-boot/ Java, Spring, Kotlin, microservices, Kubernetes, containers Wed, 21 Feb 2024 20:50:32 +0000 hourly 1 https://wordpress.org/?v=6.9.1 By: piotr.minkowski https://piotrminkowski.com/2022/02/07/deep-dive-into-saga-transactions-with-kafka-streams-and-spring-boot/#comment-2303 Wed, 21 Feb 2024 20:50:32 +0000 https://piotrminkowski.com/?p=10587#comment-2303 In reply to dofo.

Well, I’m doing that. Would be easier if you could write what exactly doesn’t work or create an issue in GitHub repo

]]>
By: dofo https://piotrminkowski.com/2022/02/07/deep-dive-into-saga-transactions-with-kafka-streams-and-spring-boot/#comment-2297 Fri, 16 Feb 2024 10:38:51 +0000 https://piotrminkowski.com/?p=10587#comment-2297 before writing an article and uploading the code to the repository, make sure that all the technologies used by you in the project are really needed and configured correctly, and the projects are collected and launched. the code provided by you in the repository is not working

]]>
By: piotr.minkowski https://piotrminkowski.com/2022/02/07/deep-dive-into-saga-transactions-with-kafka-streams-and-spring-boot/#comment-1550 Wed, 04 May 2022 10:10:38 +0000 https://piotrminkowski.com/?p=10587#comment-1550 In reply to Erkan.

Hello,
Yes, definitely this approach may be improved since it’s just a demo showing how to use Kafka to implement an example use case. But of course, if you SQS together with Kafka – Kafka does not support XA transactions so you would always have a problem covering all fail situations, so maybe outbox would a better choice in that case.

]]>
By: Erkan https://piotrminkowski.com/2022/02/07/deep-dive-into-saga-transactions-with-kafka-streams-and-spring-boot/#comment-1547 Mon, 02 May 2022 12:56:48 +0000 https://piotrminkowski.com/?p=10587#comment-1547 Hello,

I’m not familiar with Kafka. But I’m trying to apply Saga Pattern to solve a problem.

1. Create Order, Prepare user Balance.
2. Send order to external Service
3. External Service sends events over SQS, we send the related events to our service bus(Kafka/RabbitMQ)
4. Partial Complete/Complete or reject and finalize user balance.

And cover all fail stuations.

I liked your approach. But I want to apply Saga pattern to make sure we are never in inconsistent state.
Performance is also a concern but not the main one.

Can we improve your approach or do we have to use outbox pattern ?

Thanks for your time.

]]>
By: piotr.minkowski https://piotrminkowski.com/2022/02/07/deep-dive-into-saga-transactions-with-kafka-streams-and-spring-boot/#comment-1516 Fri, 25 Mar 2022 22:50:35 +0000 https://piotrminkowski.com/?p=10587#comment-1516 In reply to Oleh.

Performance is always the strong side of using Kafka. In this algorithm, the weak point is when I’m using `KafkaTemplate` to send a result of streams aggregation to the e.g. `payment-orders` topic. If e.g. Kafka broker crashes after aggregation and before sending the response it will results in system inconsistency

]]>
By: piotr.minkowski https://piotrminkowski.com/2022/02/07/deep-dive-into-saga-transactions-with-kafka-streams-and-spring-boot/#comment-1515 Fri, 25 Mar 2022 22:43:22 +0000 https://piotrminkowski.com/?p=10587#comment-1515 In reply to Daniel Manresa Menargues.

Hi! Thanks for that comment. In fact, I should remove JPA annotations since they are not needed here. It is fully based on KTable. I have just pushed the latest version to the repo

]]>
By: Daniel Manresa Menargues https://piotrminkowski.com/2022/02/07/deep-dive-into-saga-transactions-with-kafka-streams-and-spring-boot/#comment-1489 Thu, 24 Feb 2022 11:28:21 +0000 https://piotrminkowski.com/?p=10587#comment-1489 Hi Piotr.
First of all, many thanks fot the article.

I have downloaded the “streams-full” sample project, and I had to add two libraries to the “payment-service” project to successfully compile it, “spring-boot-starter-data-jpa” and “validation-api”.

When I try to start the project, It do an error due to a missing H2 Driver, so, I added this dependency too.

When the project finally run against upstash kafka server, I receive an erro due to missing topics, so, i have to manually create this topics:
customer-customer-orders-changelog
customer-customer-orders-repartition
stock-stock-orders-changelog
stock-stock-orders-repartition

]]>
By: Oleh https://piotrminkowski.com/2022/02/07/deep-dive-into-saga-transactions-with-kafka-streams-and-spring-boot/#comment-1479 Sun, 20 Feb 2022 13:35:11 +0000 https://piotrminkowski.com/?p=10587#comment-1479 Nicely done, thanks for your work writing this article. The question is: what can be the limitations of such an approach if any? I mean, in which cases such an architecture would not be advisable? E.g., could the performance of the system be seriously affected by heavy load?

]]>