- Perform database setup and get dependencies:
./script/setup.sh
- Start message consumer process:
./start-service.sh
- Start one of message producers:
./script/produce-messages_1_long_transactions.sh
./script/produce-messages_2_batches_in_contention.sh
./script/produce-messages_3_message_in_contention.sh
- Verify if number of Deposit messages equals number of Deposited. If not, you've experienced race condition in get_category_messages
psql message_store < check_messages.sql
The example illustrating long transactions (highest chance of race condition):
The example illustraing uneven but short transactions (batches of 1-2 messages):
The example illustrating most typical usage under high load:
In such case we can get IDs of events 0 and 2, but skip reading uncommitted event nr 1.