Name | rocketmq-wise JSON |
Version |
2.0.1
JSON |
| download |
home_page | None |
Summary | RocketMQ Python Client wise lib |
upload_time | 2024-04-27 06:11:09 |
maintainer | None |
docs_url | None |
author | apache.rocketmq |
requires_python | None |
license | None |
keywords |
rocketmq
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# rocketmq-client-python
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Build Status](https://travis-ci.org/apache/rocketmq-client-python.svg?branch=master)](https://travis-ci.org/apache/rocketmq-client-python)
[![codecov](https://codecov.io/gh/apache/rocketmq-client-python/branch/ctypes/graph/badge.svg)](https://codecov.io/gh/apache/rocketmq-client-python/branch/ctypes)
[![PyPI](https://img.shields.io/pypi/v/rocketmq-client-python.svg)](https://pypi.org/project/rocketmq-client-python)
RocketMQ Python client, based on [rocketmq-client-cpp](https://github.com/apache/rocketmq-client-cpp), supports Linux and macOS
## Installation
```bash
pip install rocketmq-client-python
```
## Usage
### Producer
```python
from rocketmq.client import Producer, Message
producer = Producer('PID-XXX')
producer.set_name_server_address('127.0.0.1:9876')
producer.start()
msg = Message('YOUR-TOPIC')
msg.set_keys('XXX')
msg.set_tags('XXX')
msg.set_body('XXXX')
ret = producer.send_sync(msg)
print(ret.status, ret.msg_id, ret.offset)
producer.shutdown()
```
### PushConsumer
```python
import time
from rocketmq.client import PushConsumer
def callback(msg):
print(msg.id, msg.body)
consumer = PushConsumer('CID_XXX')
consumer.set_name_server_address('127.0.0.1:9876')
consumer.subscribe('YOUR-TOPIC', callback)
consumer.start()
while True:
time.sleep(3600)
consumer.shutdown()
```
## License
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) Copyright (C) Apache Software Foundation
Raw data
{
"_id": null,
"home_page": null,
"name": "rocketmq-wise",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "rocketmq",
"author": "apache.rocketmq",
"author_email": "dev@rocketmq.apache.org",
"download_url": "https://files.pythonhosted.org/packages/ba/99/f5928e84ef6dee42e2f7d3a3a6ba0e02c2878c43ee4102371db68a65407b/rocketmq_wise-2.0.1.tar.gz",
"platform": null,
"description": "# rocketmq-client-python\r\n\r\n[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)\r\n[![Build Status](https://travis-ci.org/apache/rocketmq-client-python.svg?branch=master)](https://travis-ci.org/apache/rocketmq-client-python)\r\n[![codecov](https://codecov.io/gh/apache/rocketmq-client-python/branch/ctypes/graph/badge.svg)](https://codecov.io/gh/apache/rocketmq-client-python/branch/ctypes)\r\n[![PyPI](https://img.shields.io/pypi/v/rocketmq-client-python.svg)](https://pypi.org/project/rocketmq-client-python)\r\n\r\nRocketMQ Python client, based on [rocketmq-client-cpp](https://github.com/apache/rocketmq-client-cpp), supports Linux and macOS\r\n\r\n## Installation\r\n\r\n```bash\r\npip install rocketmq-client-python\r\n```\r\n\r\n## Usage\r\n\r\n### Producer\r\n\r\n```python\r\nfrom rocketmq.client import Producer, Message\r\n\r\nproducer = Producer('PID-XXX')\r\nproducer.set_name_server_address('127.0.0.1:9876')\r\nproducer.start()\r\n\r\nmsg = Message('YOUR-TOPIC')\r\nmsg.set_keys('XXX')\r\nmsg.set_tags('XXX')\r\nmsg.set_body('XXXX')\r\nret = producer.send_sync(msg)\r\nprint(ret.status, ret.msg_id, ret.offset)\r\nproducer.shutdown()\r\n```\r\n\r\n### PushConsumer\r\n\r\n```python\r\nimport time\r\n\r\nfrom rocketmq.client import PushConsumer\r\n\r\n\r\ndef callback(msg):\r\n print(msg.id, msg.body)\r\n\r\n\r\nconsumer = PushConsumer('CID_XXX')\r\nconsumer.set_name_server_address('127.0.0.1:9876')\r\nconsumer.subscribe('YOUR-TOPIC', callback)\r\nconsumer.start()\r\n\r\nwhile True:\r\n time.sleep(3600)\r\n\r\nconsumer.shutdown()\r\n\r\n```\r\n\r\n## License\r\n[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) Copyright (C) Apache Software Foundation\r\n",
"bugtrack_url": null,
"license": null,
"summary": "RocketMQ Python Client wise lib",
"version": "2.0.1",
"project_urls": null,
"split_keywords": [
"rocketmq"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ba99f5928e84ef6dee42e2f7d3a3a6ba0e02c2878c43ee4102371db68a65407b",
"md5": "45e4a859e7d9b3625dab6f15818fe31b",
"sha256": "06a1e1b96e04b00438420bccda5324a35e9230690a38c6da353d3892a96bee7d"
},
"downloads": -1,
"filename": "rocketmq_wise-2.0.1.tar.gz",
"has_sig": false,
"md5_digest": "45e4a859e7d9b3625dab6f15818fe31b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14446,
"upload_time": "2024-04-27T06:11:09",
"upload_time_iso_8601": "2024-04-27T06:11:09.357490Z",
"url": "https://files.pythonhosted.org/packages/ba/99/f5928e84ef6dee42e2f7d3a3a6ba0e02c2878c43ee4102371db68a65407b/rocketmq_wise-2.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-27 06:11:09",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "rocketmq-wise"
}