这个库提供了一种在使用诸如SQS和SNS之类的服务时绕过AWS大小限制的方法。

boto3-large-message-utils的Python项目详细描述


大号信息实用程序

这个库提供了一种在使用SQS和SNS等服务时绕过AWS大小限制的方法,方法是在S3中缓存消息体并在另一端再次解析它们。在

使用

安装

使用pip安装包

pip install boto3_large_message_utils

初始化处理程序

导入并设置LargeMessageBuilder

^{pr2}$

处理消息

# create your message in the normal way, build expects a stringmsg=json.dumps({'content':'this is my message'})# submit your message to the handlernew_msg=builder.build(msg)# send message to SQS, SNS or another AWS service

具有消息属性的消息

# create your message in the normal way, build expects a stringmsg=json.dumps({'content':'this is my message'})msg_attr={"MSG_ATTR":{"StringValue":"my-value"}}# submit your message to the handlermsg=builder.build(msg,msg_attr)# send message to SQS, SNS or another AWS service

解析消息

处理基地已优化的消息。在

# received message from SQS or another AWS service.parser=LargeMessageParser(#session=session, # Pass an optional boto3 session to initialise the client from the session)msg=parser.parse(received_message)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java应用程序不是在Eclipse中运行,而是在命令行中运行   swing Java图形组件问题。似乎找不到错误   我需要键盘。close();让代码正常工作?   Springboot中的java HttpSession   抽象语法树我想添加一个语句。我试图解析它,java解析器异常被抛出。如何克服它?   java Hibernate:清理会话   具有不连续子集的java划分问题   java正则表达式查找最后一个冒号后的字符串   java从SpringShell执行OS命令   Java扫描器字符串输入   java字符串索引越界异常(charAt)   java执行器服务终止被卡住   Springockito没有继承java@ContextConfiguration   java如何为一个servlet映射多个url   java安卓获取命令的stderr   java生成类型。表:数据库中的大数字   安卓 Getter Setter返回NothingJava