apache / Rocketmq Client Python
Licence: apache-2.0
Apache RocketMQ python client
Stars: ✭ 150
Programming Languages
python
139335 projects - #7 most used programming language
Labels
Projects that are alternatives of or similar to Rocketmq Client Python
Flink Learning
flink learning blog. http://www.54tianzhisheng.cn/ 含 Flink 入门、概念、原理、实战、性能调优、源码解析等内容。涉及 Flink Connector、Metrics、Library、DataStream API、Table API & SQL 等内容的学习案例,还有 Flink 落地应用的大型项目案例(PVUV、日志存储、百亿数据实时去重、监控告警)分享。欢迎大家支持我的专栏《大数据实时计算引擎 Flink 实战与性能优化》
Stars: ✭ 11,378 (+7485.33%)
Mutual labels: rocketmq
Eshop Soa
EShop基于Dubbo实现SOA服务化拆分,并基于RocketMQ解决了分布式事务(新版SpringBootSOASkeleton)
Stars: ✭ 65 (-56.67%)
Mutual labels: rocketmq
Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-33.33%)
Mutual labels: rocketmq
Myth
Reliable messages resolve distributed transactions
Stars: ✭ 1,470 (+880%)
Mutual labels: rocketmq
Javafamily
【Java面试+Java学习指南】 一份涵盖大部分Java程序员所需要掌握的核心知识。
Stars: ✭ 28,668 (+19012%)
Mutual labels: rocketmq
Whatsmars
Java生态研究(Spring Boot + Redis + Dubbo + RocketMQ + Elasticsearch)🔥🔥🔥🔥🔥
Stars: ✭ 1,389 (+826%)
Mutual labels: rocketmq
Xc Spring Cloud Alibaba
spring cloud alibaba(2.2.1最新版)+nacos+dubbo+gateWay+sentinel+rocketmq+(pgsql/mysql8.0的json支持)+ignite集成可用于docker分布式框架+分布式自动化任务+mybatis多数据源+seate+ shardingSphere分布式分库事务解决方案
Stars: ✭ 131 (-12.67%)
Mutual labels: rocketmq
Spring Boot Extend
在springboot基础上的扩展项目,快速集成Zookeeper、Dubbo、Apollo、Mybatis多数据源
Stars: ✭ 63 (-58%)
Mutual labels: rocketmq
Springboot Labs
一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024
Stars: ✭ 12,804 (+8436%)
Mutual labels: rocketmq
Newlife.rocketmq
纯托管轻量级RocketMQ客户端,支持发布消息、消费消息、负载均衡等核心功能!
Stars: ✭ 140 (-6.67%)
Mutual labels: rocketmq
Distributed framework
python通用分布式函数调度框架 pip install function_scheduling_distributed_framework
Stars: ✭ 123 (-18%)
Mutual labels: rocketmq
rocketmq-client-python
RocketMQ Python client, based on rocketmq-client-cpp, supports Linux and macOS
Prerequisites
librocketmq
Install rocketmq-client-python is a lightweight wrapper around rocketmq-client-cpp, so you need install
librocketmq
first.
Download by binary release.
download specific release according you OS: rocketmq-client-cpp-2.0.0
-
centos
take centos7 as example, you can install the library in centos6 by the same method.
wget https://github.com/apache/rocketmq-client-cpp/releases/download/2.0.0/rocketmq-client-cpp-2.0.0-centos7.x86_64.rpm sudo rpm -ivh rocketmq-client-cpp-2.0.0-centos7.x86_64.rpm
-
debian
wget https://github.com/apache/rocketmq-client-cpp/releases/download/2.0.0/rocketmq-client-cpp-2.0.0.amd64.deb sudo dpkg -i rocketmq-client-cpp-2.0.0.amd64.deb
-
macOS
wget https://github.com/apache/rocketmq-client-cpp/releases/download/2.0.0/rocketmq-client-cpp-2.0.0-bin-release.darwin.tar.gz tar -xzf rocketmq-client-cpp-2.0.0-bin-release.darwin.tar.gz cd rocketmq-client-cpp mkdir /usr/local/include/rocketmq cp include/* /usr/local/include/rocketmq cp lib/* /usr/local/lib install_name_tool -id "@rpath/librocketmq.dylib" /usr/local/lib/librocketmq.dylib
Build from source
you can also build it manually from source according to Build and Install
Installation
pip install rocketmq-client-python
Usage
Producer
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
import time
from rocketmq.client import PushConsumer, ConsumeStatus
def callback(msg):
print(msg.id, msg.body)
return ConsumeStatus.CONSUME_SUCCESS
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 Copyright (C) Apache Software Foundation
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].