KsqlDb Pull Query and messages in Topic

I’m studying a solution for a high availability store service.
I have a doubt.
Let’s say that I have a cluster kafka with n nodes, before trying to pay for an object I want to be sure that it is still available.
Now the process will be:
Pull request against a ksqlDb to check for availability, if the object is still available, the system will handle the order through a message in a topic with partition key equal to the product id to be sequential.
What happen if two customer request for availabilty in the same moment, and they send a message to buy the order in the same exact moment?
May I have a way using Kafka to stop the second one from sending the purchase event?

This topic was automatically closed after 30 days. New replies are no longer allowed.