resonate icon indicating copy to clipboard operation
resonate copied to clipboard

SQS Plugin

Open dfarr opened this issue 4 months ago • 0 comments

Resonate should support SQS as a plugin for the sender subsystem.

Sender subsystem

The sender subsystem is responsible for sending messages on supported transports (http, sqs, etc) via plugins. Currently Resonate supports:

The sqs plugin is responsible for sending a message on an SQS queue. A message is a tuple of (data, body). The body is a byte array containing the raw information to put on the SQS queue, the data is all the meta information needed to route a message to an sqs queue and can be defined per plugin. With these two pieces of information the plugin should be able to enqueue a message, once enqueued the plugin is responsible for calling the done function on the message.

Router subsystem

In addition to the sender plugin we will need to extend the router plugin to parse sqs urls. By default, Resonate matches promises by looking for the presence of a resonate:invoke tag, this tag can contain either:

  • a logical receiver (a string name that will be resolved to a phyiscal receiver later)
  • a json physical receiver
  • a url physical receiver

For SQS, a fully defined physical receiver may look like:

{ "type": "sqs", "data": { "region": "us-west-2", "queue": "my-queue", ... } }

A url physical receiver is a convenience that encodes some of the above information in a url, the scheme must match the type of the plugin - in this case sqs. For sqs this could look something like:

sqs://us-west-2/my-queue

See this function to see how we parse http and poll urls.

dfarr avatar Oct 01 '24 05:10 dfarr