Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The python Implementation For Apache Dubbo.

License

NotificationsYou must be signed in to change notification settings

apache/dubbo-python

LicenseGitHub last commitGitHub branch check runsPyPI - VersionPyPI - Python Version

Logo

Apache Dubbo is an easy-to-use, high-performance WEB and RPC framework with builtin service discovery, traffic management, observability, security features, tools and best practices for building enterprise-level microservices.

Dubbo-python is a Python implementation of thetriple protocol (a protocol fully compatible with gRPC and friendly to HTTP) and various features designed by Dubbo for constructing microservice architectures.

Visitthe official website for more information.

🚧 Early-Stage Project 🚧

Disclaimer: This project is in the early stages of development. Features are subject to change, and some components may not be fully stable. Contributions and feedback are welcome as the project evolves.

Architecture

Architecture

Features

  • Service Discovery: Zookeeper
  • Load Balance: Random, CPU
  • RPC Protocols: Triple(gRPC compatible and HTTP-friendly)
  • Transport: asyncio(uvloop)
  • Serialization: Customizable(protobuf, json...)

Installation

Before you start, make sure you havepython 3.9+ installed.

  1. Install Directly

    pip install apache-dubbo
  2. Install from source

    git clone https://github.com/apache/dubbo-python.gitcd dubbo-python&& pip install.

Getting started

Get up and running with Dubbo-Python in just 5 minutes by following ourQuick Start Guide.

It's as simple as the code snippet below. With just a few lines of code, you can launch a fully functional point-to-point RPC service:

  1. Build and start the server

    importdubbofromdubbo.configsimportServiceConfigfromdubbo.proxy.handlersimportRpcMethodHandler,RpcServiceHandlerclassUnaryServiceServicer:defsay_hello(self,message:bytes)->bytes:print(f"Received message from client:{message}")returnb"Hello from server"defbuild_service_handler():# build a method handlermethod_handler=RpcMethodHandler.unary(method=UnaryServiceServicer().say_hello,method_name="unary"    )# build a service handlerservice_handler=RpcServiceHandler(service_name="org.apache.dubbo.samples.HelloWorld",method_handlers=[method_handler],    )returnservice_handlerif__name__=="__main__":# build service configservice_handler=build_service_handler()service_config=ServiceConfig(service_handler=service_handler,host="127.0.0.1",port=50051    )# start the serverserver=dubbo.Server(service_config).start()input("Press Enter to stop the server...\n")
  2. Build and start the Client

    importdubbofromdubbo.configsimportReferenceConfigclassUnaryServiceStub:def__init__(self,client:dubbo.Client):self.unary=client.unary(method_name="unary")defsay_hello(self,message:bytes)->bytes:returnself.unary(message)if__name__=="__main__":# Create a clientreference_config=ReferenceConfig.from_url("tri://127.0.0.1:50051/org.apache.dubbo.samples.HelloWorld"    )dubbo_client=dubbo.Client(reference_config)unary_service_stub=UnaryServiceStub(dubbo_client)# Call the remote methodresult=unary_service_stub.say_hello(b"Hello from client")print(result)

Contributing

We are excited to welcome contributions to the Dubbo-Python project! Whether you are fixing bugs, adding new features, or improving documentation, your input is highly valued.

To ensure a smooth collaboration, please review ourContributing Guide for detailed instructions on how to get started, adhere to coding standards, and submit your contributions effectively.

License

Apache Dubbo-python software is licensed under the Apache License Version 2.0. SeetheLICENSE file for details.

About

The python Implementation For Apache Dubbo.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp