Simple Message Queue (SMQ, formerly MNS) SDK for Python lets you manage queues, topics, and subscriptions programmatically.
Install the SDK
Install the latest version from PyPI:
pip install aliyun-mns-sdkFor source code and release history, see the aliyun-mns-python-sdk repository on GitHub.
Usage notes
The examples in this documentation use SMQ SDK for Python 1.2.0. For the full version history, see Versions.
For debugging, use the latest SDK version.
The
Account,Queue,Topic, andSubscriptionclasses are not thread-safe. Create a separate instance for each thread in multi-threaded applications.
Sample code
The SDK includes sample code for queue and topic operations.
Queue operations
Operation | Guide | Source code |
Create a queue | ||
Delete a queue | ||
Send a message | ||
Receive and consume a message |
Topic operations
Operation | Guide | Source code |
Create a topic | ||
Create a subscription with a queue endpoint | ||
Delete a topic | ||
Publish a message |