{"id":27323330,"url":"https://github.com/spinframework/spin-trigger-sqs","last_synced_at":"2026-02-26T19:24:38.237Z","repository":{"id":104355875,"uuid":"605775123","full_name":"spinframework/spin-trigger-sqs","owner":"spinframework","description":"A trigger plugin for processing SQS messages using Spin","archived":false,"fork":false,"pushed_at":"2025-08-26T22:14:09.000Z","size":364,"stargazers_count":8,"open_issues_count":6,"forks_count":14,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-08-27T05:55:34.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spinframework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-23T21:52:40.000Z","updated_at":"2025-08-26T21:42:45.000Z","dependencies_parsed_at":"2023-11-23T04:33:32.294Z","dependency_job_id":"efc376b0-f87b-47c7-86bf-9b98add15b72","html_url":"https://github.com/spinframework/spin-trigger-sqs","commit_stats":null,"previous_names":["spinframework/spin-trigger-sqs","fermyon/spin-trigger-sqs"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/spinframework/spin-trigger-sqs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-trigger-sqs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-trigger-sqs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-trigger-sqs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-trigger-sqs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spinframework","download_url":"https://codeload.github.com/spinframework/spin-trigger-sqs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-trigger-sqs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005928,"owners_count":26083998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-12T10:37:26.550Z","updated_at":"2026-02-20T00:15:19.117Z","avatar_url":"https://github.com/spinframework.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Experimental SQS trigger for Spin\n\n## Install the latest release\n\nThe latest stable release of the SQS trigger plugin can be installed like so:\n\n```sh\nspin plugins update\nspin plugins install trigger-sqs\n```\n\n## Install the canary version\n\nThe canary release of the SQS trigger plugin represents the most recent commits on `main` and may not be stable, with some features still in progress.\n\n```sh\nspin plugins install --url https://github.com/spinframework/spin-trigger-sqs/releases/download/canary/trigger-sqs.json\n```\n\n## Build from source\n\nYou will need Rust and the `pluginify` plugin (`spin plugins install --url https://github.com/itowlson/spin-pluginify/releases/download/canary/pluginify.json`).\n\n```\ncargo build --release\nspin pluginify --install\n```\n\n## Test\n\nThe end-to-end test runs a local ElasticMQ container, builds and installs the plugin, creates a test queue, updates the example guest app to point to the test queue, builds the guest app, starts Spin, sends a test message to the queue, and verifies that the message is processed as expected.\n\n### Prerequisites\n\n- [Rust](https://rustup.rs/) (1.90 or later)\n- [Spin](https://developer.fermyon.com/spin/install) (v3.3.0 or later)\n- [AWS CLI](https://aws.amazon.com/cli/)\n- [Docker](https://docs.docker.com/get-docker/) (for running ElasticMQ in a container)\n- `make` utility\n\n### Run Full E2E Test\n\nThis will automatically set up ElasticMQ, run the tests, and clean up:\n\n```bash\nmake test-e2e-full\n```\n\nThis uses the [elasticmq.conf](elasticmq.conf) configuration file to set up ElasticMQ with appropriate settings for testing.\n\n### Manual Testing\n\nIf you prefer to control ElasticMQ separately:\n\n1. **Start ElasticMQ container:**\n   ```bash\n   make setup-elasticmq\n   ```\n\n   This will:\n   - Pull the `softwaremill/elasticmq:latest` Docker image\n   - Mount the [elasticmq.conf](elasticmq.conf) configuration file\n   - Start a container named `spin-sqs-elasticmq` on port 9324\n\n2. **Run the tests:**\n   ```bash\n   make test-e2e\n   ```\n\n3. **Stop ElasticMQ container:**\n   ```bash\n   make stop-elasticmq\n   ```\n\n   This will stop and remove the container.\n\n## Limitations\n\nThis trigger is currently built using Spin 2.0.1. You will need that version of Spin or above.\n\nCustom triggers, such as this one, can be run in the Spin command line, but cannot be deployed to Fermyon Cloud.  For other hosts, check the documentation.\n\n## Configuration\n\nThe SQS trigger uses the AWS credentials from the standard AWS configuration environment variables.  These variables must be set before you run `spin up`.  The credentials must grant access to all queues that the application wants to monitor.  The credentials must allow for reading messages and deleting read messages.\n\nThe trigger assumes that the monitored queues exist: it does not create them.\n\n### `spin.toml`\n\nThe trigger type is `sqs`, and there are no application-level configuration options.\n\nThe following options are available to set in the `[[trigger.sqs]]` section:\n\n| Name                  | Type             | Required? | Description |\n|-----------------------|------------------|-----------|-------------|\n| `queue_url`           | string           | required | The queue to which this trigger listens and responds. |\n| `max_messages`        | number           | optional | The maximum number of messages to fetch per AWS queue request. The default is 10. This refers specifically to how messages are fetched from AWS - the component is still invoked separately for each message. |\n| `idle_wait_seconds`   | number           | optional | How long (in seconds) to wait between checks when the queue is idle (i.e. when no messages were received on the last check). The default is 2. If the queue is _not_ idle, there is no wait between checks. The idle wait is also applied if an error occurs. |\n| `system_attributes`   | array of strings | optional | The list of system-defined [attributes](https://docs.rs/aws-sdk-sqs/latest/aws_sdk_sqs/operation/receive_message/builders/struct.ReceiveMessageFluentBuilder.html#method.set_attribute_names) to fetch and make available to the component. |\n| `message_attributes`  | array of strings | optional | The list of [message attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html) to fetch and make available to the component. Only string and binary values are supported. |\n| `component`           | string or table  | required | The component to run when a queue message is received. (This is the standard Spin trigger component field.) |\n\nFor example:\n\n```toml\nspin_manifest_version = 2\n\n[application]\nname = \"test\"\nversion = \"0.1.0\"\n\n# One [[trigger.sqs]] section for each queue to monisot1\n[[trigger.sqs]]\nqueue_url = \"https://sqs.us-west-2.amazonaws.com/12345/testqueue\"\nmax_messages = 1\nsystem_attributes = [\"All\"]\ncomponent = \"test\"\n\n[component.test]\nsource = \"...\"\n```\n\n### `spin up` command line options\n\nThere are no custom command line options for this trigger.\n\n## Writing SQS components\n\nThere is no SDK for SQS guest components.  Use the `sqs.wit` file to generate a trigger binding for your language.  Your Wasm component must _export_ the `handle-queue-message` function.  See `guest/src/lib.rs`  for how to do this in Rust.\n\n**Note:** In the current WIT, a message has a single `message-attributes` field. This contains both system and message attributes. Feedback is welcome on this design decision.\n\nYour handler must return a `message-action` (or an error).  The `message-action` values are:\n\n| Name       | Description |\n|------------|-------------|\n| `delete`   | The message has been processed and should be removed from the queue. |\n| `leave`    | The message should be kept on the queue. |\n\nThe trigger renews the message lease for as long as the handler is running.\n\n**Note:** The current trigger implementation does not make the message visible immediately if the handler returns `leave` or an error; it lets the message become visible through the normal visibility timeout mechanism.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinframework%2Fspin-trigger-sqs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspinframework%2Fspin-trigger-sqs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinframework%2Fspin-trigger-sqs/lists"}