MQ消息工具(生产者、消费者封装)。
Project description
使用手册
快速开始
- 生产者
import mqplus
producer = mqplus.RabbitProducer("docker.kancy.top", "root", "root123")
producer.putMessage("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.1.tar.gz
(5.5 kB
view hashes)
Built Distributions
mqplus-0.0.1-py3.9.egg
(7.6 kB
view hashes)
Close
Hashes for mqplus-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b9cb1c6fd70f240873682024b7ef0330e2ecd9ca45ef7e119067979c98bf2eb |
|
MD5 | 937a138e868eda1ad867880c1d627189 |
|
BLAKE2b-256 | e132d43210a439de19957fc67fb7fc50128d62836ba7bf4b54a50b7b96dda4e1 |