Giter VIP home page Giter VIP logo

dubbo-telnet-py's Introduction

Dubbo Telnet Client of python

通过telnet调用Dubbo接口, 可用来做Dubbo的自动化测试。

兼容性测试

  • Python 2.6.6
  • Python 2.7.10
  • Python 3.4.3

安装

  • easyinstall安装
easy_install dubbo_telnet
  • pip安装
pip install --upgrade dubbo_telnet
  • git安装
pip install --upgrade git+https://github.com/WALL-E/dubbo-telnet-py.git

Example

    import dubbo_telnet

    Host = '192.168.1.203'  # Doubble服务器IP
    Port = 28008  # Doubble服务端口

    # 初始化dubbo对象
    conn = dubbo_telnet.connect(Host, Port)

    # 设置telnet连接超时时间
    conn.set_connect_timeout(10)

    # 设置dubbo服务返回响应的编码
    conn.set_encoding('gbk')

    interface = 'com.zrj.pay.trade.api.QueryTradeService'
    method = 'tradeDetailQuery'
    param = '{"id": 1}'
    print conn.invoke(interface, method, param)

    command = 'invoke com.zrj.pay.trade.api.QueryTradeService.tradeDetailQuery({"id":1})'
    print conn.do(command)

Dubbo Telnet命令

Dubbo2.0.5以上版本服务提供端口支持telnet命令,使用如下

telnet localhost 20880

或者

echo status | nc -i 1 localhost 20880

详见Dubbo官方文档Telnet命令参考手册

Todo

  • 使用pexpect替换telnetlib

dubbo-telnet-py's People

Contributors

wall-e avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.