MQ消息工具(生产者、消费者封装)。
Project description
使用手册
快速开始
- 生产者
import mqplus
producer = mqplus.RabbitProducer("docker.kancy.top", "root", "root123")
producer.putQueue("test", "pika.test.queue")
# 注册交换机
producer.registerExchange("pika.test.exchange", 'direct')
# 注册队列
producer.registerQueue("pika.test.queue", durable=True)
# 绑定交换机很队列
producer.bind("pika.test.exchange", "pika.test.queue")
- 消费者
import mqplus
def handle_message(data, **kwargs):
print(kwargs)
consumer = mqplus.RabbitConsumer("docker.kancy.top", "root", "root123")
consumer.onListener("pika.test.queue", callback=handle_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
mqplus-0.0.2.tar.gz
(3.8 kB
view hashes)
Built Distributions
mqplus-0.0.2-py3.9.egg
(2.8 kB
view hashes)
Close
Hashes for mqplus-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1771cc0181c2bee1299b8128acf378df355562138fc3f9da41724f0dc1ae17 |
|
MD5 | 97797f6fde5f8dfcabed4e09a2e35e53 |
|
BLAKE2b-256 | ee582aa03d311665b80b5a4dd36626b788d51af261d317db5af4b12c37282ebe |