sqs-extended-client
Implements the functionality of amazon-sqs-java-extended-client-lib in Python
Installation
pip install sqs-extended-client
Overview
sqs-extended-client allows for sending large messages through SQS via S3. This is the same mechanism that the Amazon library amazon-sqs-java-extended-client-lib provides. This library is interoperable with that library.
To do this, this library automatically extends the normal boto3 SQS client and Queue resource classes upon import using the botoinator library. This allows for further extension or decoration if desired.
Additional attributes available on boto3 SQS client and Queue objects
- large_payload_support -- the S3 bucket name that will store large messages.
- message_size_threshold -- the threshold for storing the message in the large messages bucket. Cannot be less than
0or greater than262144. Defaults to262144. - always_through_s3 -- if
True, then all messages will be serialized to S3. Defaults toFalse - s3 -- the boto3 S3
resourceobject to use to store objects to S3. Use this if you want to control the S3 resource (for example, custom S3 config or credentials). Defaults toboto3.resource("s3")on first use if not previously set.
Usage
Note:
The s3 bucket must already exist prior to usage, and be accessible by whatever credentials you have available
Enabling support for large payloads (>256Kb)
import boto3
import sqs_extended_client
# Low level client
sqs = boto3.client('sqs')
sqs.large_payload_support = 'my-bucket-name'
# boto resource
resource = boto3.resource('sqs')
queue = resource.Queue('queue-url')
# Or
queue = resource.create_queue(QueueName='queue-name')
queue.large_payload_support = 'my-bucket-name'
Enabling support for large payloads (>64K)
import boto3
import sqs_extended_client
# Low level client
sqs = boto3.client('sqs')
sqs.large_payload_support = 'my-bucket-name'
sqs.message_size_threshold = 65536
# boto resource
resource = boto3.resource('sqs')
queue = resource.Queue('queue-url')
# Or
queue = resource.create_queue(QueueName='queue-name')
queue.large_payload_support = 'my-bucket-name'
queue.message_size_threshold = 65536
Enabling support for large payloads for all messages
import boto3
import sqs_extended_client
# Low level client
sqs = boto3.client('sqs')
sqs.large_payload_support = 'my-bucket-name'
sqs.always_through_s3 = True
# boto resource
resource = boto3.resource('sqs')
queue = resource.Queue('queue-url')
# Or
queue = resource.create_queue(QueueName='queue-name')
queue.large_payload_support = 'my-bucket-name'
queue.always_through_s3 = True
Setting a custom S3 resource
import boto3
from botocore.config import Config
import sqs_extended_client
# Low level client
sqs = boto3.client('sqs')
sqs.large_payload_support = 'my-bucket-name'
sqs.s3 = boto3.resource(
's3',
config=Config(
signature_version='s3v4',
s3={
"use_accelerate_endpoint": True
}
)
)
# boto resource
resource = boto3.resource('sqs')
queue = resource.Queue('queue-url')
# Or
queue = resource.create_queue(QueueName='queue-name')
queue.large_payload_support = 'my-bucket-name'
queue.s3 = boto3.resource(
's3',
config=Config(
signature_version='s3v4',
s3={
"use_accelerate_endpoint": True
}
)
)
Metadata
Release files for sqs-extended-client 0.0.11
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 | Actions |
|---|---|---|---|---|
| sqs-extended-client-0.0.11.tar.gz | 10.4 kB | Without provenance | Details for sqs-extended-client-0.0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sqs_extended_client-0.0.11-py3-none-any.whl | Python 3 | none | any | Details for sqs_extended_client-0.0.11-py3-none-any.whl |
Total release size: 20.5 kB
Release files / sqs-extended-client-0.0.11.tar.gz
| Download URL | sqs-extended-client-0.0.11.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4af8b405776cdf134afd065950e7f3d3a752aec7c9fe3f0dddc33ab1e99f698
|
|
BLAKE2b-256 checksum How to use checksums |
632a2909a7e02920b619136f5acf3d036fe7d54bcbbe18bfacda141c4e74e005
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.18
|
Release files / sqs_extended_client-0.0.11-py3-none-any.whl
| Download URL | sqs_extended_client-0.0.11-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5197848f7f38fd7f75dc0d76fe1b4a020be4b5b0c02a1aea20484dfca075475d
|
|
BLAKE2b-256 checksum How to use checksums |
de49c056bfb05b65aaeb94d18e8b5ed15b35a274fb46c39e1375f13e8093805a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.18
|
Security for sqs-extended-client 0.0.11
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.