rocketmq-python-cvs


Namerocketmq-python-cvs JSON
Version 2.1.0.3 PyPI version JSON
download
home_page
SummaryRocketMQ Python Client CVS
upload_time2023-09-08 02:57:05
maintainer
docs_urlNone
authorkarl zhou
requires_python
license
keywords rocketmq
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # rocketmq-python-cvs

[![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

use librocketmq.so custom 

## Installation

```bash
pip install rocketmq-python-cvs
```

## Usage

### Producer

```python
from rocketmq.client import Producer, Message

producer = Producer('PID-XXX')
producer.set_log_root_path('/opt/app/karl_demo')
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_log_root_path('/opt/app/karl_demo')
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": "",
    "name": "rocketmq-python-cvs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "rocketmq",
    "author": "karl zhou",
    "author_email": "qipeng@conversant.com.sg",
    "download_url": "https://files.pythonhosted.org/packages/c8/19/5a8d8a5a259f7cbecc34407ed4f6707858438806c9307bc96e7a8db93b13/rocketmq-python-cvs-2.1.0.3.tar.gz",
    "platform": null,
    "description": "# rocketmq-python-cvs\n\n[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)\n[![Build Status](https://travis-ci.org/apache/rocketmq-client-python.svg?branch=master)](https://travis-ci.org/apache/rocketmq-client-python)\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)\n[![PyPI](https://img.shields.io/pypi/v/rocketmq-client-python.svg)](https://pypi.org/project/rocketmq-client-python)\n\nRocketMQ Python client, based on [rocketmq-client-cpp](https://github.com/apache/rocketmq-client-cpp), supports Linux and macOS\n\nuse librocketmq.so custom \n\n## Installation\n\n```bash\npip install rocketmq-python-cvs\n```\n\n## Usage\n\n### Producer\n\n```python\nfrom rocketmq.client import Producer, Message\n\nproducer = Producer('PID-XXX')\nproducer.set_log_root_path('/opt/app/karl_demo')\nproducer.set_name_server_address('127.0.0.1:9876')\nproducer.start()\n\nmsg = Message('YOUR-TOPIC')\nmsg.set_keys('XXX')\nmsg.set_tags('XXX')\nmsg.set_body('XXXX')\nret = producer.send_sync(msg)\nprint(ret.status, ret.msg_id, ret.offset)\nproducer.shutdown()\n```\n\n### PushConsumer\n\n```python\nimport time\n\nfrom rocketmq.client import PushConsumer\n\n\ndef callback(msg):\n    print(msg.id, msg.body)\n\n\nconsumer = PushConsumer('CID_XXX')\nconsumer.set_log_root_path('/opt/app/karl_demo')\nconsumer.set_name_server_address('127.0.0.1:9876')\nconsumer.subscribe('YOUR-TOPIC', callback)\nconsumer.start()\n\nwhile True:\n    time.sleep(3600)\n\nconsumer.shutdown()\n\n```\n\n## License\n[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) Copyright (C) Apache Software Foundation\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "RocketMQ Python Client CVS",
    "version": "2.1.0.3",
    "project_urls": null,
    "split_keywords": [
        "rocketmq"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c8195a8d8a5a259f7cbecc34407ed4f6707858438806c9307bc96e7a8db93b13",
                "md5": "635081eed9c15d442c1f0f441e1356e5",
                "sha256": "99e4ce8008554a74193a3ad94b60f939a4666c48ffabbf4c4417a109daf1419d"
            },
            "downloads": -1,
            "filename": "rocketmq-python-cvs-2.1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "635081eed9c15d442c1f0f441e1356e5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 1443464,
            "upload_time": "2023-09-08T02:57:05",
            "upload_time_iso_8601": "2023-09-08T02:57:05.627600Z",
            "url": "https://files.pythonhosted.org/packages/c8/19/5a8d8a5a259f7cbecc34407ed4f6707858438806c9307bc96e7a8db93b13/rocketmq-python-cvs-2.1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-08 02:57:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "rocketmq-python-cvs"
}
        
Elapsed time: 0.12520s