Skip to main content

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duConsumer-0.0.4-py3-none-any.whl (1.8 kB view details)

Uploaded Python 3

File details

Details for the file duConsumer-0.0.4.tar.gz.

File metadata

  • Download URL: duConsumer-0.0.4.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for duConsumer-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7d6ceb9cb1218267d5b7af08a60b3fdd6f8b11e3621614e901c6278ee3b92d40
MD5 324f775fbc61c4e0098580ed2c13545d
BLAKE2b-256 2c17cab46c1d5df92e303bf501dce6ba494f992f35335a6edc3d860a776804d8

See more details on using hashes here.

File details

Details for the file duConsumer-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: duConsumer-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 1.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for duConsumer-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7ecd0e2b068deb991df42cf551457f5babfe1b0e3143fa6e0ba2c234dc40258a
MD5 17e7693b3881b80ff1cd8637a1825458
BLAKE2b-256 fd9e54366f89b769d8afcd20cfd343385f94c0cf0634231a644b83eae29ab36c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page