Message persisting logic in this diff:
- On gRPC Send request we are storing a message to the dynamoDB database before the AMQP message is pushed to the RabbitMQ. In this case, we are making sure that the message is persisted and we don't rely on the RabbitMQ delivery only.
- On gRPC Get request, we are retrieving the messages for the deviceID from the dynamoDB database first and delivering them to the device.
- After retrieving messages from the database, wait for the messages from the AMQP message broker (RabbitMQ);
- Follow-up messages are delivered as Get stream request messages;
- On message broker (RabbitMQ) message delivery, delete that message from the database by unique messageID.