比较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.

# git clone https://github.com/dubbo/dubbo-samples.git
# 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

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

Define service interfaces

package org.apache.dubbo.demo.api;

public interface GreetingService {
String sayHello(String name);
}

See api/GreetingService.java on GitHub.

Implement service interface for the provider

package org.apache.dubbo.demo.provider;

import org.apache.dubbo.demo.GreetingService;

public class GreetingServiceImpl implements GreetingService {
public String sayHello(String name) {
return "Hello " + name;
}
}

See provider/GreetingServiceImpl.java on GitHub.

Start service provider

package org.apache.dubbo.demo.provider;

import com.alibaba.dubbo.config.ApplicationConfig;
import 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

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

Call remote service in consumer

package org.apache.dubbo.demo.consumer;

import com.alibaba.dubbo.config.ApplicationConfig;
import 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

# mvn clean package
# 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

Spring Boot Dubbo Dubbok spring cloud的更多相关文章

  1. Spring Boot Dubbo applications.properties 配置清单

    摘要: 原创出处 www.bysocket.com 「泥瓦匠BYSocket 」欢迎转载,保留摘要,谢谢! 『 与其纠结,不如行动学习.Innovate ,And out execute ! 』 本文 ...

  2. 【spring cloud】子模块module -->导入一个新的spring boot项目作为spring cloud的一个子模块微服务,怎么做/或者 每次导入一个新的spring boot项目,IDEA不识别子module,启动类无法启动/右下角没有蓝色图标

    如题:导入一个新的spring boot项目作为spring cloud的一个子模块微服务,怎么做 或者说每次导入一个新的spring boot项目,IDEA不识别,启动类无法启动,怎么解决 下面分别 ...

  3. Spring Boot可以离开Spring Cloud独立使用开发项目,但是Spring Cloud离不开Spring Boot,属于依赖的关系。

    Spring Boot 是 Spring 的一套快速配置脚手架,可以基于Spring Boot 快速开发单个微服务,Spring Cloud是一个基于Spring Boot实现的云应用开发工具:Spr ...

  4. spring boot +dubbo+zookeeper

    dubbo是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案. 结合本公司的开发也是用的dubbo这款优秀的框架,加上 最近工作重心的.所以对于dubbo的 ...

  5. Spring Boot版本,Spring Cloud版本与组件版本关系

    我们在学习Spring Cloud时,可能总是碰到以下问题: 1.Spring Boot版本与Spring Cloud版本关系 2.启动时,报莫名其妙的错,稀里糊涂的换个版本就好了 3.这么多版本,用 ...

  6. Spring Boot(十三):spring boot小技巧

    Spring Boot(十三):spring boot小技巧 一.初始化数据 我们在做测试的时候经常需要初始化导入一些数据,如何来处理呢?会有两种选择,一种是使用Jpa,另外一种是Spring JDB ...

  7. spring boot入门教程——Spring Boot快速入门指南

    Spring Boot已成为当今最流行的微服务开发框架,本文是如何使用Spring Boot快速开始Web微服务开发的指南,我们将使创建一个可运行的包含内嵌Web容器(默认使用的是Tomcat)的可运 ...

  8. 【Spring Boot】利用 Spring Boot Admin 进行项目监控管理

    利用 Spring Boot Admin 进行项目监控管理 一.Spring Boot Admin 是什么 Spring Boot Admin (SBA) 是一个社区开源项目,用于管理和监视 Spri ...

  9. Spring Boot (十): Spring Boot Admin 监控 Spring Boot 应用

    Spring Boot (十): Spring Boot Admin 监控 Spring Boot 应用 1. 引言 在上一篇文章<Spring Boot (九): 微服务应用监控 Spring ...

随机推荐

  1. Node.js搭建本地web服务(转)

    http://www.cnblogs.com/wangfupeng1988/p/4143996.html https://github.com/finderL/webserver

  2. maven介绍 极客学院

    来自极客学院 Apache Maven 是一套软件工程管理和整合工具.基于工程对象模型(POM)的概念,通过一个中央信息管理模块,Maven 能够管理项目的构建.报告和文档. Maven - 概述 M ...

  3. idea 编程字体推荐

    monaco vardana fira code mediu dejavu sans mono 上述字体 在14号字 1.1倍行距 时编程比较舒服

  4. Tokyo Tyrant(TTServer)系列(六)-数据丢失谁的错

    ,false,1,100);$mem->addServer ("127.9.9.1",1978,false,1,100);$start=microtime(true);for ...

  5. 在Unity控制台下使用富文本

    之前都不知道,最近看了csdn一位开发者的博文突然发现 <b>asd</b> <color="red">asd</color> &l ...

  6. 多线程-ReentrantReadWriteLock

    ReentrantLock具有完全互斥排他的效果,即同一时间只有一个线程在执行ReentrantLock.lock()方法后面的任务.这样做虽然保证了实例变量的线程安全,但效率却是非常低下的.JDK中 ...

  7. Windows 内核(WRK)简介

    引子 WRK 是微软于 2006 年针对教育和学术界开放的 Windows 内核的部分源码,WRK(Windows Research Kernel)也就是 Windows 研究内核,在 WRK 中不仅 ...

  8. vim语法高亮插件编写

    # vim语法高亮插件编写 编写vim语法高亮插件很简单,只需要编写两个文件.vim放到vim的安装目录下的目录就可以了. ## 输出------------------------------ sy ...

  9. 把以逗号分隔的字符串转换成list

    /** * 把省的字符串转换成列表 * * @param province * @return */ private List<String> getProvinceList(String ...

  10. 跟着百度学PHP[15]-会话控制session的工作机制

    COOKIE和SESSION的两大区别: cookie是存储与客户端 session是存储与服务端 需要开启session的时候需要使用session_start开启,且session的开头不能拥有任 ...