Spring Boot Dubbo Dubbok spring cloud

比较spring cloud和dubbo,各自的优缺点是什么 - 趁年轻再疯狂一次吧 - CSDN博客 https://blog.csdn.net/u010664947/article/details/80007767

网易考拉海购Dubbok框架优化详解_存储_基础信息化_文章_e-works数字化企业网 http://articles.e-works.net.cn/storage/article133435.htm

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 dubbo-samples-api sub directory before read on.

1# git clone https://github.com/dubbo/dubbo-samples.git 2# cd dubbo-samples/dubbo-samples-api

There's a README file under dubbo-samples-api directory. Read it and try this sample out by following the instructions.

Maven dependency

1<dependency> 2 <groupId>com.alibaba</groupId> 3 <artifactId>dubbo</artifactId> <version>2.6.4</version> </dependency>

Define service interfaces

1package org.apache.dubbo.demo.api; 2 3public interface GreetingService { String sayHello(String name); }

See api/GreetingService.java on GitHub.

Implement service interface for the provider

1package org.apache.dubbo.demo.provider; 2 3import org.apache.dubbo.demo.GreetingService; 4 5public class GreetingServiceImpl implements GreetingService { public String sayHello(String name) { return "Hello " + name; } }

See provider/GreetingServiceImpl.java on GitHub.

Start service provider

1package org.apache.dubbo.demo.provider; 2 3import com.alibaba.dubbo.config.ApplicationConfig; 4import com.alibaba.dubbo.config.RegistryConfig; import com.alibaba.dubbo.config.ServiceConfig; import org.apache.dubbo.demo.GreetingService; import java.io.IOException; public class Application { public static void main(String[] args) throws IOException { ServiceConfig<GreetingService> serviceConfig = new ServiceConfig<GreetingService>(); serviceConfig.setApplication(new ApplicationConfig("first-dubbo-provider")); serviceConfig.setRegistry(new RegistryConfig("multicast://224.5.6.7:1234")); serviceConfig.setInterface(GreetingService.class); serviceConfig.setRef(new GreetingServiceImpl()); serviceConfig.export(); System.in.read(); } }

See provider/Application.java on GitHub.

Build and run the provider

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

Call remote service in consumer

1package org.apache.dubbo.demo.consumer; 2 3import com.alibaba.dubbo.config.ApplicationConfig; 4import com.alibaba.dubbo.config.ReferenceConfig; import com.alibaba.dubbo.config.RegistryConfig; import org.apache.dubbo.demo.GreetingService; public class Application { public static void main(String[] args) { ReferenceConfig<GreetingService> referenceConfig = new ReferenceConfig<GreetingService>(); referenceConfig.setApplication(new ApplicationConfig("first-dubbo-consumer")); referenceConfig.setRegistry(new RegistryConfig("multicast://224.5.6.7:1234")); referenceConfig.setInterface(GreetingService.class); GreetingService greetingService = referenceConfig.get(); System.out.println(greetingService.sayHello("world")); } }

Build and run the consumer

1# mvn clean package 2# mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.demo.consumer.Application exec:java

The consumer will print out Hello world on the screen.

See consumer/Application.java on GitHub.

Next steps

Contact

Contributing

See CONTRIBUTING for details on submitting patches and the contribution workflow.

How can I contribute?

  • Take a look at issues with tag called Good first issue or Help wanted.
  • Join the discussion on mailing list, subscription guide.
  • Answer questions on issues.
  • Fix bugs reported on issues, and send us pull request.
  • Review the existing pull request.
  • Improve the website, typically we need
    • blog post
    • translation on documentation
    • use cases about how Dubbo is being used in enterprise system.
  • Improve the dubbo-ops/dubbo-monitor.
  • Contribute to the projects listed in ecosystem.
  • Any form of contribution that is not mentioned above.
  • If you would like to contribute, please send an email to dev@dubbo.incubator.apache.org to let us know!

Reporting bugs

Please follow the template for reporting any issues.

Reporting a security vulnerability

Please report security vulnerability to us privately.

Dubbo eco system

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )