Using messageID to remove a certain message from the delivery queue, instead of using a receiver deviceID to remove all messages for the device.
1. Message structure changed
To achieve this the DeliveryBroker internal message structure needs to be changed from the current:
map[reciever deviceID] → vector<Message information>
to:
map[receiver deviceID] → Queue → Message information.
2. Conditional variables+mutexes became folly:: UnboundedQueue.
Conditional variables and mutex were removed in favor of folly:: UnboundedQueue
3. Remove is became pop as we are using a queue instead of a map.
The remove function changed to pop to remove the first message from the queue.
4. Function names usage refactoring due to the above changes.
Usage of the functions is also refactored in AMQP and gRPC handlers.
Review notes:
These diffs changes are closely interconnected with each other and it's effective for review to use one diff instead of splitting it. This is a smaller chunk of changes that can be buildable. Removing mutexes is closely interconnected with the structural changes that's why it is related to two tasks simultaneously.
Related linear tasks: