onestep-sqs
Amazon SQS connector plugin for onestep. The package also ships an Amazon SNS
topic sink for fan-out publishing.
pip install onestep-sqs
The package registers these YAML resource types through the onestep.resources
entry point:
sqssqs_queuesnssns_topic
Python usage:
from onestep_sqs import SQSConnector, SNSConnector
Delivery metadata
Fetched messages keep the existing OneStep body decoding behavior and expose
SQS system metadata under delivery.envelope.meta["sqs"]:
{
"message_id": "00000000-0000-0000-0000-000000000000",
"attributes": {
"ApproximateReceiveCount": "2",
"SentTimestamp": "1720000000000",
},
}
The current message's MessageId sets message_id. Its Attributes sets
attributes to an isolated snapshot of the complete system attributes
dictionary. When no existing SQS metadata or current system fields are
available, meta["sqs"] is an empty dictionary.
Existing envelope meta and attempts values are preserved. If the encoded
envelope already contains a meta["sqs"] dictionary, its other keys are kept.
The reserved message_id and attributes keys are populated only from the
current SQS response, so missing fields do not inherit stale transport values.
ReceiptHandle remains internal to acknowledgement, retry, and release
operations. Custom SQS MessageAttributes are not exposed in the envelope.
Shutdown and pause behavior
SQS receives use a blocking long poll, so shutdown, drain, and pause wait for the current poll to finish instead of cancelling it. Any deliveries returned after fetching has stopped are released immediately with a visibility timeout of zero when processing has not started, making them available to SQS consumers again without waiting for the configured visibility timeout.
SNS topic sink
SNS is publish/subscribe only, so SNSTopic implements Sink (not Source).
To consume SNS messages, subscribe an SQS queue to the topic and use
sqs_queue as the source.
from onestep import MemoryQueue, OneStepApp
from onestep_sqs import SNSConnector
app = OneStepApp("sns-demo")
sns = SNSConnector(region_name="us-east-1")
notify = sns.topic(
"arn:aws:sns:us-east-1:123456789012:events",
subject="onestep-event",
)
@app.task(source=MemoryQueue("jobs"), emit=notify)
async def publish_event(ctx, job):
return {"id": job["id"], "status": "done"}
The task return value is encoded with the standard OneStep envelope codec and
sent as the SNS Message. Configuration options:
subject: optional SNSSubject.message_attributes: raw SNSMessageAttributesmapping for subscription filter policies.message_group_id/deduplication_id_factory: required (group) and optional (dedup) for FIFO topics whose ARN ends in.fifo. The factory receives theEnvelopeand returns the deduplication id string.retry_delay_s: retry backoff hint applied to normalized connector errors.
YAML:
resources:
sns:
type: sns
region_name: us-east-1
notify:
type: sns_topic
connector: sns
arn: arn:aws:sns:us-east-1:123456789012:events
subject: onestep-event
Metadata
Release files for onestep-sqs 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| onestep_sqs-0.2.4.tar.gz | 14.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| onestep_sqs-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.4 kB
Release files / onestep_sqs-0.2.4.tar.gz
| Download URL | onestep_sqs-0.2.4.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fdb30955c3a8a1eb1a982e00cd530fcc0c8087aef5391facc3cc38f17230406e
|
|
BLAKE2b-256 checksum How to use checksums |
5b6395723a6ca3a81d7f5608d552775caad5fd33d538184d40646d5fbd739e58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / onestep_sqs-0.2.4-py3-none-any.whl
| Download URL | onestep_sqs-0.2.4-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70c58e84589e2184fda397e1d11ac6717be8fc11d00d16ef58c269663fa8c49d
|
|
BLAKE2b-256 checksum How to use checksums |
02618fa43e2d1fb33ad3295fdd588678cbc2d128c4c2c16b639a23bdf9b457bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for onestep-sqs 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.