Page MenuHomePhabricator

[services] Tunnelbroker - Adding delivering messages from the deliveryBroker to the messages stream
ClosedPublic

Authored by max on Nov 9 2022, 3:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 2:54 AM
Unknown Object (File)
Fri, Dec 6, 10:33 PM
Unknown Object (File)
Fri, Nov 29, 11:18 AM
Unknown Object (File)
Fri, Nov 29, 11:07 AM
Unknown Object (File)
Tue, Nov 26, 5:55 AM
Unknown Object (File)
Sun, Nov 24, 6:32 AM
Unknown Object (File)
Sun, Nov 24, 6:32 AM
Unknown Object (File)
Sun, Nov 24, 6:32 AM

Details

Summary

This diff adds immediate delivery of messages when the client is online and connected to the bidirectional stream. We are using the AMQP server to immediately send/receive messages.

When the client sends a message to another client through the Tunnelbroker, the message is stored in the database and the AMQP message is put into the AMQP server queue to which the Tunnelbroker (or another Tunnelbroker instance) is listen for new messages to come. After the new message is came from the AMQP server we will send it to the client as the MessagesToDeliver by the gRPC stream message.

The client will process the message and send back the processed message ID to the Tunnelbroker as processedMessages only after that, we will delete messages from the database.

Removing of processed messages implemented in D5584.

Linear task: ENG-2060

Test Plan
  1. Connect by the gRPC client to the bidirectional stream with the sessionID corresponding to the deviceID in metadata.
  2. Insert a message in the database into the messages table with the corresponding deviceID in the toDeviceID field.
  3. Put a message into the AMQP queue with the corresponding deviceID in the toDeviceID field in the message amqp header.

The expected result is that the message would be delivered to the client as the MessagesToDeliver.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.

Adding of deliveryTag field into message struct.

Adding of AMQP message acknowledgement.

max edited the test plan for this revision. (Show Details)
max added reviewers: varun, marcin. max added 1 blocking reviewer(s): jon.
max published this revision for review.Nov 9 2022, 7:24 AM
max edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Nov 9 2022, 11:04 AM
This revision now requires review to proceed.Nov 10 2022, 2:17 AM
This revision is now accepted and ready to land.Nov 17 2022, 2:53 AM

Rebasing on parents changes.

This revision was landed with ongoing or failed builds.Nov 21 2022, 6:04 AM
This revision was automatically updated to reflect the committed changes.