195 Star 817 Fork 0

Apache / dubbo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Apache Dubbo Project

Build and Test For PR Codecov Maven License Average time to resolve an issue Percentage of issues still open

Apache Dubbo is a high-performance, Java-based open-source RPC framework. Please visit the official site for the quick start guide and documentation, as well as the wiki for news, FAQ, and release notes.

We are now collecting Dubbo user info to help us to improve Dubbo further. Kindly support us by providing your usage information on Wanted: who's using dubbo, thanks :)

Architecture

Architecture

Features

  • Transparent interface based RPC
  • Intelligent load balancing
  • Automatic service registration and discovery
  • High extensibility
  • Runtime traffic routing
  • Visualized service governance

Getting started

The following code snippet comes from Dubbo Samples. You may clone the sample project and step into the dubbo-samples-api subdirectory before proceeding.

git clone https://github.com/apache/dubbo-samples.git
cd dubbo-samples/1-basic/dubbo-samples-api

There's a README file under dubbo-samples-api directory. We recommend referencing the samples in that directory by following the below-mentioned instructions:

Maven dependency

<properties>
    <dubbo.version>3.2.11</dubbo.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.apache.dubbo</groupId>
        <artifactId>dubbo</artifactId>
        <version>${dubbo.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.dubbo</groupId>
        <artifactId>dubbo-dependencies-zookeeper</artifactId>
        <version>${dubbo.version}</version>
        <type>pom</type>
    </dependency>
</dependencies>

Define service interfaces

package org.apache.dubbo.samples.api;

public interface GreetingsService {
    String sayHi(String name);
}

See api/GreetingsService.java on GitHub.

Implement service interface for the provider

package org.apache.dubbo.samples.provider;

import org.apache.dubbo.samples.api.GreetingsService;

public class GreetingsServiceImpl implements GreetingsService {
    @Override
    public String sayHi(String name) {
        return "hi, " + name;
    }
}

See provider/GreetingsServiceImpl.java on GitHub.

Start service provider

package org.apache.dubbo.samples.provider;


import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.ServiceConfig;
import org.apache.dubbo.samples.api.GreetingsService;

import java.util.concurrent.CountDownLatch;

public class Application {
    private static String zookeeperHost = System.getProperty("zookeeper.address", "127.0.0.1");

    public static void main(String[] args) throws Exception {
        ServiceConfig<GreetingsService> service = new ServiceConfig<>();
        service.setApplication(new ApplicationConfig("first-dubbo-provider"));
        service.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181"));
        service.setInterface(GreetingsService.class);
        service.setRef(new GreetingsServiceImpl());
        service.export();

        System.out.println("dubbo service started");
        new CountDownLatch(1).await();
    }
}

See provider/Application.java on GitHub.

Build and run the provider

mvn clean package
mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.samples.provider.Application exec:java

Call remote service in the consumer

package org.apache.dubbo.samples.client;


import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.samples.api.GreetingsService;

public class Application {
    private static String zookeeperHost = System.getProperty("zookeeper.address", "127.0.0.1");

    public static void main(String[] args) {
        ReferenceConfig<GreetingsService> reference = new ReferenceConfig<>();
        reference.setApplication(new ApplicationConfig("first-dubbo-consumer"));
        reference.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181"));
        reference.setInterface(GreetingsService.class);
        GreetingsService service = reference.get();
        String message = service.sayHi("dubbo");
        System.out.println(message);
    }
}

See client/Application.java on GitHub.

Build and run the consumer

mvn clean package
mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.samples.client.Application exec:java

The consumer will print out hi, dubbo on the screen.

Next steps

Building

If you want to try out the cutting-edge features, you can build with the following commands. (Java 1.8 is needed to build the master branch)

  mvn clean install

Recommended Test Environment

To avoid intermittent test failures (i.e., flaky tests), it is recommended to have a machine or virtual machine with the following specifications:

  • Minimum of 2CPUs.
  • Minimum of 2Gb of RAM.

How does the Dubbo Community collaborate?

The Dubbo Community primarily communicates on GitHub through issues, discussions, and pull requests.

  • Issues: We use issues to track bugs and tasks. Any work-related item is associated with an issue.
  • Discussions: We use discussions for questions, early proposals, and announcements. Any idea-related item is associated with a discussion.
  • Pull Requests: We use pull requests to merge a set of changes from contributors into Dubbo.

We have also implemented a project board to monitor all the items.

Any essential changes should be discussed on the mailing list before they happen.

Seeking for help

If you have questions such as:

  • What is Dubbo?
  • How do I use Dubbo?
  • Why did an unexpected result occur?

Please start a discussion at https://github.com/apache/dubbo/discussions.

However, if you encounter the following situations:

  • You're certain there's a bug that Dubbo needs to fix,
  • You believe a feature could be enhanced,
  • You have a detailed proposal for improving Dubbo,

Please open an issue at https://github.com/apache/dubbo/issues.

To ask effective questions, we recommend reading How To Ask Questions The Smart Way first.

Contribution

  • Browse the "help wanted" tasks in the Dubbo project board.
  • Participate in discussions on the mailing list. See the subscription guide.
  • Respond to queries in the discussions.
  • Resolve bugs reported in issues and send us a pull request.
  • Review existing pull requests.
  • Enhance the website. We typically need:
    • Blog posts
    • Translations for documentation
    • Use cases showcasing Dubbo integration in enterprise systems.
  • Improve the dubbo-admin.
  • Contribute to the projects listed in the ecosystem.
  • Any other forms of contribution not listed above are also welcome.
  • If you're interested in contributing, please send an email to dev@dubbo.apache.org to let us know!

For further details, please refer our guide about how to contribute Dubbo.

Reporting bugs

Please follow the template for reporting any issues.

Reporting a security vulnerability

Please report security vulnerabilities to us privately.

Contact

Dubbo ecosystem

Language

License

Apache Dubbo software is licensed under the Apache License Version 2.0. See the LICENSE file for details.

header: license: spdx-id: Apache-2.0 content: | Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. paths-ignore: - '**/*.versionsBackup' - '**/.idea/' - '**/*.iml' - '**/.settings/*' - '**/.classpath' - '**/.project' - '**/target/**' - '**/generated/**' - '**/*.log' - '**/codestyle/*' - '**/resources/META-INF/**' - '**/resources/mockito-extensions/**' - '**/*.proto' - '**/*.cache' - '**/*.txt' - '**/*.load' - '**/*.flex' - '**/*.fc' - '**/*.javascript' - '**/*.properties' - '**/*.sh' - '**/*.bat' - '**/*.md' - '**/*.svg' - '**/*.png' - '**/*.json' - '**/*.conf' - '**/*.ftl' - '**/*.tpl' - '**/*.factories' - '**/*.handlers' - '**/*.schemas' - '**/*.nojekyll' - '.git/' - '.github/**' - '**/.gitignore' - '**/.helmignore' - '.repository/' - 'compiler/**' - '.gitmodules' - '.mvn' - 'mvnw' - 'mvnw.cmd' - 'LICENSE' - 'NOTICE' - 'CNAME' - 'Jenkinsfile' - '**/vendor/**' - '**/src/test/resources/certs/**' - '**/src/test/resources/definition/**' - 'dubbo-common/src/main/java/org/apache/dubbo/common/threadlocal/InternalThreadLocal.java' - 'dubbo-common/src/main/java/org/apache/dubbo/common/threadlocal/InternalThreadLocalMap.java' - 'dubbo-common/src/main/java/org/apache/dubbo/common/timer/HashedWheelTimer.java' - 'dubbo-common/src/main/java/org/apache/dubbo/common/timer/Timeout.java' - 'dubbo-common/src/main/java/org/apache/dubbo/common/timer/Timer.java' - 'dubbo-common/src/main/java/org/apache/dubbo/common/timer/TimerTask.java' - 'dubbo-common/src/main/java/org/apache/dubbo/common/utils/CIDRUtils.java' - 'dubbo-common/src/main/java/org/apache/dubbo/common/utils/Utf8Utils.java' - 'dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/EmbeddedZooKeeper.java' - 'dubbo-test/dubbo-test-common/src/main/java/org/apache/dubbo/test/common/utils/TestSocketUtils.java' - 'dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriHttp2RemoteFlowController.java' - 'dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/serial/SerializingExecutor.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractAotMojo.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractDependencyFilterMojo.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/CommandLineBuilder.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/DependencyFilter.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Exclude.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/ExcludeFilter.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/FilterableDependency.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Include.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/IncludeFilter.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaCompilerPluginConfiguration.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaExecutable.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaProcessExecutor.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/MatchingGroupIdFilter.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunArguments.java' - 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunProcess.java' - 'dubbo-native/src/main/java/org/apache/dubbo/aot/generate/BasicJsonWriter.java' - 'dubbo-native/src/main/java/org/apache/dubbo/aot/generate/ExecutableMode.java' - 'dubbo-native/src/main/java/org/apache/dubbo/aot/generate/MemberCategory.java' - 'dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/aggregate/DubboMergingDigest.java' - 'dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/aggregate/DubboAbstractTDigest.java' comment: on-failure license-location-threshold: 130 dependency: files: - pom.xml - dubbo-dependencies-bom/pom.xml licenses: - name: com.alibaba.spring:spring-context-support license: Apache-2.0 - name: com.fasterxml.jackson.core:jackson-annotations license: Apache-2.0 - name: com.fasterxml.jackson.core:jackson-core license: Apache-2.0 - name: com.fasterxml.jackson.core:jackson-databind license: Apache-2.0 - name: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml license: Apache-2.0 - name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 license: Apache-2.0 - name: com.google.code.gson:gson license: Apache-2.0 - name: com.google.guava:listenablefuture license: Apache-2.0 - name: com.salesforce.servicelibs:grpc-contrib license: BSD 3-clause - name: com.squareup.okhttp3:logging-interceptor license: Apache-2.0 - name: com.squareup.okhttp3:okhttp license: Apache-2.0 - name: com.squareup.okio:okio license: Apache-2.0 - name: com.sun.xml.fastinfoset:FastInfoset license: Apache-2.0 - name: io.envoyproxy.controlplane:api license: Apache-2.0 - name: io.swagger:swagger-annotations license: Apache-2.0 - name: io.swagger:swagger-models license: Apache-2.0 - name: org.springframework.boot:spring-boot license: Apache-2.0 - name: org.springframework.boot:spring-boot-actuator license: Apache-2.0 - name: org.springframework.boot:spring-boot-autoconfigure license: Apache-2.0 - name: org.springframework.boot:spring-boot-configuration-processor license: Apache-2.0 - name: org.springframework.boot:spring-boot-starter license: Apache-2.0 - name: org.springframework.boot:spring-boot-starter-actuator license: Apache-2.0 - name: org.springframework.boot:spring-boot-starter-logging license: Apache-2.0 - name: org.springframework.boot:spring-boot-starter-tomcat license: Apache-2.0 - name: org.springframework.boot:spring-boot-starter-web license: Apache-2.0 - name: org.slf4j:slf4j-api license: MIT - name: org.slf4j:slf4j-log4j12 license: MIT - name: org.jboss.resteasy:resteasy-jaxrs license: Apache-2.0 - name: org.jboss.resteasy:resteasy-client license: Apache-2.0 - name: org.jboss.resteasy:resteasy-netty4 license: Apache-2.0 - name: org.jboss.resteasy:resteasy-jdk-http license: Apache-2.0 - name: org.jboss.resteasy:resteasy-jackson-provider license: Apache-2.0 - name: org.jboss.resteasy:resteasy-jaxb-provider license: Apache-2.0 - name: net.jcip:jcip-annotations license: Apache-2.0 - name: org.apache.zookeeper:zookeeper license: Apache-2.0 - name: org.apache.zookeeper:zookeeper-jute license: Apache-2.0 - name: net.bytebuddy:byte-buddy license: Apache-2.0 - name: javax.enterprise:cdi-api license: Apache-2.0 - name: org.codehaus.plexus:plexus-component-annotations license: Apache-2.0 - name: org.slf4j:jcl-over-slf4j license: Apache-2.0 - name: org.slf4j:jul-to-slf4j license: Apache-2.0 - name: org.codehaus.plexus:plexus-interpolation license: Apache-2.0 - name: org.sonatype.plexus:plexus-sec-dispatcher license: Apache-2.0 - name: org.sonatype.plexus:plexus-cipher license: Apache-2.0 - name: com.google.protobuf:protobuf-java license: BSD 3-clause - name: com.google.protobuf:protobuf-java-util license: BSD 3-clause # multi license - name: org.javassist:javassist license: Apache-2.0 - name: javax.annotation:javax.annotation-api license: CDDL-1.0 - name: com.salesforce.servicelibs:jprotoc license: CDDL-1.0 - name: org.checkerframework:checker-compat-qual license: MIT - name: ch.qos.logback:logback-classic license: EPL-1.0 - name: ch.qos.logback:logback-core license: EPL-1.0 - name: javax.servlet:javax.servlet-api license: CDDL-1.1 - name: com.sun.activation:javax.activation license: CDDL-1.1 - name: javax.activation:activation license: CDDL-1.1 - name: jakarta.annotation:jakarta.annotation-api license: EPL-2.0 - name: org.glassfish:jakarta.el license: EPL-2.0 - name: org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec license: CDDL-1.1 - name: org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec license: EPL-2.0 - name: org.jboss.spec.javax.annotation:jboss-annotations-api_1.3_spec license: EPL-2.0 excludes: - name: javax.xml.bind:jsr173_api

简介

Dubbo 是一个高性能优秀的服务框架,使得应用可通过高性能的 RPC 实现服务的输出和输入功能,可以和 Spring 框架无缝集成 展开 收起
Java 等 3 种语言
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/apache/dubbo.git
git@gitee.com:apache/dubbo.git
apache
dubbo
dubbo
3.2

搜索帮助