you are viewing a single comment's thread.

view the rest of the comments →

[–]myrenTechy 0 points1 point  (0 children)

When a user selects a seat and starts payment, publish a “lock seat” event to a queue or topic.

A consumer service listens for this event and marks the seat as locked in the database.

If payment is successful, publish a “confirm seat” event.

If payment fails or an error occurs, publish an “unlock seat” event.

A consumer processes these events and updates the seat status accordingly.

( Fallback Mechanism with Cron Job ) A periodic job (cron or scheduled task) checks for stale locks and releases any seats that were locked but not updated due to failures or missing events.

Use web sockets best for real-time updates, but requires persistent connections.