JuliaComputing / AMQPClient.jl

A Julia AMQP (Advanced Message Queuing Protocol) / RabbitMQ Client.
Other
39 stars 21 forks source link

fix race condition in basic_consume #28

Closed tanmaykm closed 3 years ago

tanmaykm commented 3 years ago

There was a race condition in basic_consume where we may receive pending messages for a consumer immediately after call to basic_consume and before the consumer task is fully registered at our end.

This fixes the race condition by buffering such messages until the consumer task is created. The same buffer is shared with the message consumer task when it gets instantiated and thus no messages are lost.

Also fixed tests to ensure queues are deleted only once. (deleting multiple times may fail)

Fixes: #26 Fixes: #14