Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SocketDock to Aries Mediator Service to make HA Mediator #82

Open
swcurran opened this issue Jul 11, 2023 · 0 comments
Open

Add SocketDock to Aries Mediator Service to make HA Mediator #82

swcurran opened this issue Jul 11, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@swcurran
Copy link
Contributor

swcurran commented Jul 11, 2023

With the availability of SocketDock (https://github.com/hyperledger/aries-socketdock) to nicely take care of managing WebSocket connections with mobile agents, it would be helpful to implement a version of an Aries Mediator with SocketDock, ideally combined with Redis. Per the diagram for SocketDock:

image

Managing WebSocket connections becomes a matter of tracking SocketDock HTTP addresses for connected agents against the DIDComm address for the agent. Something like this (seems right -- but details left for the implementation):

  • When an agent is not connected to the mediator, queue up its messages in a "not connected" queue by DIDComm agent endpoint.
  • When an agent connects with the mediator (POST to messageuri), record the DIDComm/HTTP relationship, and send all queued message for the DIDComm agent to the HTTP address. Arriving messages while the connection is established are sent to the HTTP address.
  • When the DIDComm agent explicitly disconnects from SocketDock (POST to disconnecturi from image), remove the DIDComm agent endpoint/HTTP relationship, and push any unsent messages to the "not connected" queue.
  • When a post to the HTTP address for an agent (POST to externalhostandport) fails, assume the connection is lost, remove the DIDComm agent endpoint/HTTP relationship, and push any unsent messages to the "not connected" queue.

In implementing this, an effort should be made to make all components stateless so that a full HA (high availability) mediator can be deployed, with all components scalable. That implies a need to use Redis for the queuing and for cache consistency for the DIDComm/HTTP address tracking.

The redis work in this PR #78 will be helpful in implementing this.

The underlying mediator can be any component -- ACA-Py, AFJ, or even a "custom" DIDComm mediator.

@swcurran swcurran added the help wanted Extra attention is needed label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant