- We need to make sure that each message is delivered to client.
- We need to persist it immediately after receiving
- Message will be removed after confirmation from client
Depends on D9312
Differential D9313
[Tunnelbroker] always persist gRPC messages in database kamil on Sep 28 2023, 7:35 AM. Authored by Tags None Referenced Files
Details
Depends on D9312
#[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(); }
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
Diff Detail
Event TimelineComment Actions Did you think of expected behavior in case of failure? Comment Actions Yes, created ENG-5149 to discuss this, initially I wanted to implement option 2, but probably we can discuss it.
Yes, this diff intention to make it mandatory to put messages in DDB. Failures are separate thing, handling will be tracked in ENG-5149. |