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.3.tar.gz
(9.2 kB
view hashes)
Built Distribution
duConsumer-0.0.3-py3-none-any.whl
(10.3 kB
view hashes)
Close
Hashes for duConsumer-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d667204127325fbdaed51187748c875a29e7525aff8d0e37daa8b2b633098e8b |
|
MD5 | b6839ba754dbe05dd1029765ebd28d1a |
|
BLAKE2b-256 | 54b4de5a477413ec995f65912cb7e83bee5f1888ea07ff2b26778d079d12360a |