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.
# 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
- Your first Dubbo application - A 101 tutorial to reveal more details, with the same code above.
- Dubbo user manual - How to use Dubbo and all its features.
- Dubbo developer guide - How to invovle in Dubbo development.
- Dubbo admin manual - How to admin and manage Dubbo services.
Contact
Mailing list:
- dev list: for dev/user discussion. subscribe, unsubscribe, archive, guide
Bugs: Issues
Gitter: Gitter channel
Twitter: @ApacheDubbo
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
orHelp 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
- Dubbo Ecosystem Entry - A GitHub group
dubbo
to gather all Dubbo relevant projects not appropriate in apache group yet - Dubbo Website - Apache Dubbo (incubating) official website
- Dubbo Samples - samples for Apache Dubbo (incubating)
- Dubbo Spring Boot - Spring Boot Project for Dubbo
- Dubbo OPS - The reference implementation for Dubbo admin
Spring Boot Dubbo Dubbok spring cloud的更多相关文章
- Spring Boot Dubbo applications.properties 配置清单
摘要: 原创出处 www.bysocket.com 「泥瓦匠BYSocket 」欢迎转载,保留摘要,谢谢! 『 与其纠结,不如行动学习.Innovate ,And out execute ! 』 本文 ...
- 【spring cloud】子模块module -->导入一个新的spring boot项目作为spring cloud的一个子模块微服务,怎么做/或者 每次导入一个新的spring boot项目,IDEA不识别子module,启动类无法启动/右下角没有蓝色图标
如题:导入一个新的spring boot项目作为spring cloud的一个子模块微服务,怎么做 或者说每次导入一个新的spring boot项目,IDEA不识别,启动类无法启动,怎么解决 下面分别 ...
- Spring Boot可以离开Spring Cloud独立使用开发项目,但是Spring Cloud离不开Spring Boot,属于依赖的关系。
Spring Boot 是 Spring 的一套快速配置脚手架,可以基于Spring Boot 快速开发单个微服务,Spring Cloud是一个基于Spring Boot实现的云应用开发工具:Spr ...
- spring boot +dubbo+zookeeper
dubbo是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案. 结合本公司的开发也是用的dubbo这款优秀的框架,加上 最近工作重心的.所以对于dubbo的 ...
- Spring Boot版本,Spring Cloud版本与组件版本关系
我们在学习Spring Cloud时,可能总是碰到以下问题: 1.Spring Boot版本与Spring Cloud版本关系 2.启动时,报莫名其妙的错,稀里糊涂的换个版本就好了 3.这么多版本,用 ...
- Spring Boot(十三):spring boot小技巧
Spring Boot(十三):spring boot小技巧 一.初始化数据 我们在做测试的时候经常需要初始化导入一些数据,如何来处理呢?会有两种选择,一种是使用Jpa,另外一种是Spring JDB ...
- spring boot入门教程——Spring Boot快速入门指南
Spring Boot已成为当今最流行的微服务开发框架,本文是如何使用Spring Boot快速开始Web微服务开发的指南,我们将使创建一个可运行的包含内嵌Web容器(默认使用的是Tomcat)的可运 ...
- 【Spring Boot】利用 Spring Boot Admin 进行项目监控管理
利用 Spring Boot Admin 进行项目监控管理 一.Spring Boot Admin 是什么 Spring Boot Admin (SBA) 是一个社区开源项目,用于管理和监视 Spri ...
- Spring Boot (十): Spring Boot Admin 监控 Spring Boot 应用
Spring Boot (十): Spring Boot Admin 监控 Spring Boot 应用 1. 引言 在上一篇文章<Spring Boot (九): 微服务应用监控 Spring ...
随机推荐
- PHP下用Memcache 实现消息队列
Memcache 一般用于缓存服务.但是很多时候,比如一个消息广播系统,需要一个消息队列.直接从数据库取消息,负载往往不行.如果将整个消息队列用一个key缓存到memcache里面, 对于一个很大的消 ...
- tomcat中的Manager App帐号password管理
tomcat根文件夹下的conf文件夹下有个tomcat-users.xml文件 填写内容例如以下 <? xml version='1.0' encoding='utf-8'? >< ...
- [转]Linux(Ubuntu)下如何安装JDK
转自:http://www.cnblogs.com/savagemorgan/p/3650926.html 注:这篇博客里面有两个问题 1.解压的时候不用sudo,mv的时候不用sudo,我的安装路径 ...
- The Definitive Guide To Django 2 学习笔记(三) URLconfs 和松耦合
前面的例子体现了一个设计模式中的重要思想,松耦合. 不论我们是将/time/改成/current_time/,还是新建一个/another-time-page/同样指向views.py中的 curre ...
- 利用RPM和YUM安装软件
安装软件事root的事,所以必须要以root身份登录! 假设我要安装一个文件名为rp-pppoe-3.5-32.1.i386.rpm的文件, 那么我们可以这样: rpm安装软件 rpm -ivh pa ...
- JSON简述
JSON(JavaScript Object Notation) JavaScript 对象表示法,是一种轻量级的数据交换格式.类似于XML. 基础结构 JSON基于两种结构(即由两种结构组成:对象( ...
- Linux环境下连接Mssql 2008
首先,Linux环境装个驱动:Microsoft® SQL Server® ODBC Driver 1.0 for Linuxhttps://www.microsoft.com/en-us/downl ...
- hdu3667 Transportation 费用与流量平方成正比的最小流 拆边法+最小费用最大流
/** 题目:hdu3667 Transportation 拆边法+最小费用最大流 链接:http://acm.hdu.edu.cn/showproblem.php?pid=3667 题意:n个城市由 ...
- python_集合_笔记
集合 特性: a.确定性(元素必须可以hash) b.互异性(去重) c.无序性(集合中的元素没有先后之分) 集合关系测试 交集 & jihe1.intersection(jihe2) 差集 ...
- angular 输入属性@Input , 输出属性@Output , 中间人模式
1 输入属性 通常用于父组件向子组件传递信息 举个栗子:我们在父组件向子组件传递股票代码,这里的子组件我们叫它app-order 首先在app.order.component.ts中声明需要由父组件传 ...