1. Restart RabbitMQ
2. Restart localstack
3. Run this code:
```
#[tokio::test]
async fn send_grpc() {
let refresh_request = RefreshKeyRequest {
device_id: "test_persist".to_string(),
number_of_keys: 5,
};
let request = MessageToDevice {
device_id: "test_persist".to_string(),
payload: serde_json::to_string(&refresh_request).unwrap(),
};
let grpc_message = tonic::Request::new(request);
TunnelbrokerServiceClient::connect("http://localhost:50051")
.await
.unwrap()
.send_message_to_device(grpc_message)
.await
.unwrap();
}
```
4. Open RabbitMQ management console, there should be one dropped message (there is no device with `test_persist` ID)
[ss]
5. Open DynamoDB console, message should be persisted:
[ss].
6. Additionally, check TB logs for:
```
2023-09-27T13:47:23.107877Z DEBUG tunnelbroker::grpc: Received message for test_persist
2023-09-27T13:47:23.107920Z DEBUG tunnelbroker::database: Persisting message to device: test_persist
```