python调用dubbo,目前支持dubbo协议,不需要服务端修改成jsonrpc.实现客户端的负载均衡、配合Zookeeper自动发现服务功能等
Project description
依赖pyhessian,bitstring
示例代码
from dubbo import DubboConsumer def print_hi(consumer): req = consumer.queryCusStatis([("Lcom/weimob/o2o/wecom/data/api/interfaces/query/request/CusStatisRequest;", {"corpid": 1, "dateRangeType": 3})]) print(f'req: {req!r}') for dto in req.responseVo.data.cusStatisDayDtos: print(f'dto: {dto!r}') if __name__ == '__main__': consumer = DubboConsumer("10.11.32.251:2181", "com.weimob.o2o.wecom.data.api.interfaces.query.QueryCusApi") print_hi(consumer)
具体参照测main.py,目前支持常用的dubbo协议。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
duConsumer-0.0.4.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for duConsumer-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ecd0e2b068deb991df42cf551457f5babfe1b0e3143fa6e0ba2c234dc40258a |
|
MD5 | 17e7693b3881b80ff1cd8637a1825458 |
|
BLAKE2b-256 | fd9e54366f89b769d8afcd20cfd343385f94c0cf0634231a644b83eae29ab36c |