Comments on: Kafka Streams with Spring Cloud Stream https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/ Java, Spring, Kotlin, microservices, Kubernetes, containers Wed, 21 Feb 2024 20:52:52 +0000 hourly 1 https://wordpress.org/?v=6.9.1 By: piotr.minkowski https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-2305 Wed, 21 Feb 2024 20:52:52 +0000 https://piotrminkowski.com/?p=10193#comment-2305 In reply to Maddipatla Madhura.

done

]]>
By: piotr.minkowski https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-2304 Wed, 21 Feb 2024 20:52:41 +0000 https://piotrminkowski.com/?p=10193#comment-2304 In reply to Maddipatla Madhura.

count – number of products, amount – the price for the whole order

]]>
By: Maddipatla Madhura https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-2295 Thu, 15 Feb 2024 14:29:20 +0000 https://piotrminkowski.com/?p=10193#comment-2295 Sometimes it was count and sometimes it was amount. please clarify

]]>
By: Maddipatla Madhura https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-2294 Thu, 15 Feb 2024 14:17:06 +0000 https://piotrminkowski.com/?p=10193#comment-2294 private Transaction execute(Order orderBuy, Order orderSell) {
if (orderBuy.getAmount() >= orderSell.getAmount()) {
int count = Math.min(orderBuy.getProductCount(), orderSell.getProductCount());
boolean allowed = logic.performUpdate(orderBuy.getId(), orderSell.getId(), count);

Here it was called count

But when go into

@Transactional
public boolean performUpdate(Long buyOrderId, Long sellOrderId, int amount) {
Order buyOrder = repository.findById(buyOrderId).orElseThrow();
Order sellOrder = repository.findById(sellOrderId).orElseThrow();
int buyAvailableCount = buyOrder.getProductCount() – buyOrder.getRealizedCount();
int sellAvailableCount = sellOrder.getProductCount() – sellOrder.getRealizedCount();
if (buyAvailableCount >= amount && sellAvailableCount >= amount) {

Here it was called amount.

Please clarify on this

]]>
By: piotr.minkowski https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-2105 Fri, 25 Aug 2023 12:35:19 +0000 https://piotrminkowski.com/?p=10193#comment-2105 In reply to metaor.

Thanks for suggestion

]]>
By: piotr.minkowski https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-2104 Fri, 25 Aug 2023 12:11:41 +0000 https://piotrminkowski.com/?p=10193#comment-2104 In reply to Dina.

Thanks!

]]>
By: Dina https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-2101 Fri, 25 Aug 2023 10:30:56 +0000 https://piotrminkowski.com/?p=10193#comment-2101 Great example covering the core areas of the spring cloud kafka.

]]>
By: metaor https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-1780 Tue, 03 Jan 2023 09:32:21 +0000 https://piotrminkowski.com/?p=10193#comment-1780 Any reason that you integrate database with KStream to aim Transactions? I think this is blocking I/O point. Imagine you want to process thousands of orders per second. KStream has stateful operation, why not relying on it?

]]>
By: piotr.minkowski https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-1743 Thu, 08 Dec 2022 09:27:10 +0000 https://piotrminkowski.com/?p=10193#comment-1743 In reply to Erol.

Hi Erol,
Kafka Streams is a client library that interacts with Kafka. This is a similar concept for example to Java streams, but operations you are doing are persisted in the Kafka topics

]]>
By: Dan https://piotrminkowski.com/2021/11/11/kafka-streams-with-spring-cloud-stream/#comment-1724 Tue, 22 Nov 2022 09:20:47 +0000 https://piotrminkowski.com/?p=10193#comment-1724 Dzięki za dzielenie się taką wiedzą 🙂

]]>