Skip to main content

Message Queue Client for Python

生成安装包

参考 https://packaging.python.org/tutorials/packaging-projects/

  • 升级安装必要工具
python3 -m pip install --upgrade build
python3 -m pip install --user --upgrade twine
  • 生成安装包
python3 -m build
  • 上传安装包
python3 -m twine upload --repository-url https://<私有镜像地址> dist/*

默认上传到 https://pypi.org

python3 -m twine upload  dist/*

使用安装包

  • install
pip3 install xmq-python
  • 发送消息
from xmq_python.producer import Producer
producer = Producer(mq_type='AMQO', host='', port=0, access_key='', access_secret='', timeout=None, max_message_size=None, username='', password='', virtual_host='', instance_id='')
producer.start()
producer.Publish('order','demand',{"id":123, "name": "neil"})
producer.stop()
  • 接收消息
from xmq_python.consumer import Consumer
import time
def callback(message):
    print("Got message: ", message)
    return True
consumer = Consumer(mq_type='AMQO', consumer_group_name='', host='', port=0, access_key='', access_secret='', timeout=None, max_message_size='', username='', password='', virtual_host='', instance_id='')
consumer.Register("order","demand",callback)
consumer.start()
time.sleep(100)
consumer.stop()

Release files for xmq-python 0.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xmq-python 0.0.13
File Size Uploaded
xmq-python-0.0.13.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xmq-python 0.0.13
File Interpreter ABI Platform
xmq_python-0.0.13-py3-none-any.whl Python 3 none any Details

Total release size: 27.5 kB

Release files / xmq-python-0.0.13.tar.gz

Download URL xmq-python-0.0.13.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a3c5619413bb0fe9e08ae77a48b015280a41a7a290d6b76222872d96960b95ac
BLAKE2b-256 checksum
How to use checksums
1c291fbfe8743757bdec94bf11a9912a7a38a541d2557a5e253e073f105a2cbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

Release files / xmq_python-0.0.13-py3-none-any.whl

Download URL xmq_python-0.0.13-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f85b7afaa7ccb85d9538bbfe6e0727da1a79d0ad6176d1e835e3a0120fb64594
BLAKE2b-256 checksum
How to use checksums
606ddd9af7356022ab387d2819669113d3987b93b4d8d6317d2b0558b39ed255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.0.13 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page