This library provides a way of bypassing AWS size restrictions when using services such as SQS and SNS.
Project description
boto3_large_message_utils
This library provides a way of bypassing AWS size restrictions when using services such as SQS and SNS, by providing methods to cache message bodies in S3 and parse them again at the other end.
Usage
Install the package using pip
pip install boto3_large_message_utils
Import and set up the LargeMessageHandler
from boto3_large_message_utils import LargeMessageHandler
msg_handler = LargeMessageHandler(
s3_bucket_for_cache='my-bucket', #REQUIRED
s3_object_prefix='my-prefix',
compress=True,
message_size_threshold=100000,
#session=session, # Pass an optional boto3 session to initialise the client from the session
)
# create your message in the normal way, submit_message expects a string
my_message = json.dumps({ 'content': 'this is my message' })
# submit your message to the handler
message = msg_handler.submit_message(my_message)
# send message to SQS, SNS or another AWS service
Handle a message that has been optimised by the LargeMessageHandler.
# received message from SQS or another AWS service.
my_message = msg_handler.parse_message(received_message)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for boto3_large_message_utils-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b224af83d6271b12e27a8a0e3f5342590c0bf87dd1fbfc0dac5991905404267 |
|
MD5 | 4f815118ccf8c566ecc5c373dc00cdd2 |
|
BLAKE2b-256 | 58762c58ffa550331c45304399caa43c51b33aa863bd466841e14a3a89fc2562 |
Close
Hashes for boto3_large_message_utils-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a2df21ea5b0cb3b92ef98cd934b3cde4e50eda58399f6f80bb5d77b42bc7a1e |
|
MD5 | 6dbd79cdbbedb6f10bf1424f95e62d06 |
|
BLAKE2b-256 | 7ae8ef1bca1749a2dc905355a634dba0ddced0527d566c89809df001dc942a99 |