SOFARPC 简介
SOFARPC 是一个高可扩展性、高性能、生产级的 Java RPC 框架。在蚂蚁金服 SOFARPC 已经经历了十多年及五代版本的发展。SOFA RPC 致力于简化应用之间的 RPC 调用,为应用提供方便透明、稳定高效的点对点远程服务调用方案。为了用户和开发者方便的进行功能扩展,SOFARPC 提供了丰富的模型抽象和可扩展接口,包括过滤器、路由、 负载均衡 等等。同时围绕 SOFARPC 框架及其周边组件提供丰富的微服务治理方案。
功能特性
- 透明化、高性能的远程服务调用
- 支持多种服务路由及负载均衡策略
- 支持多种注册中心的集成
- 支持多种协议,包括 Bolt、Rest、 Dubbo 等
- 支持同步、单向、回调、泛化等多种调用方式
- 支持集群容错、服务预热、自动故障隔离
- 强大的扩展功能,可以按需扩展各个功能组件
开发环境支持
1、编译需要 JDK 7 及以上、Maven 3.2.5 及以上
2、运行需求 JDK 6 及以上
基本原理
1、当一个 SOFARPC 的应用启动的时候,如果发现当前应用需要发布 RPC 服务的话,那么 SOFARPC 会将这些服务注册到服务注册中心上。如图中 Service 指向 Registry。
2、当引用这个服务的 SOFARPC 应用启动时,会从服务注册中心订阅到相应服务的 元数据 信息。服务注册中心收到订阅请求后,会将发布方的元数据列表实时推送给服务引用方。如图中 Registry 指向 Reference。
3、当服务引用方拿到 地址 以后,就可以从中选取地址发起调用了。如图中 Reference 指向 Service。
快速开始
演示如何应用 SOFARPC 进行服务的发布和引用。 本例将在本地模拟服务端启动监听一个端口并发布一个服务,客户端引用该服务进行直连调用。
第一步:新建一个 Maven 工程,并引入 SOFARPC 的依赖
<dependency> <groupId>com.alipay.sofa</groupId> <artifactId>sofa-rpc-all</artifactId> <version>5.5.3</version> </dependency>
版本下载地址:
第二步:编写服务端实现
创建接口HelloService
/** * Quick Start demo interface */public interface HelloService { String sayHello(String string); }
创建接口实现HelloServiceImpl
/** * Quick Start demo implement */public class HelloServiceImpl implements HelloService { @Override public String sayHello(String string) { System.out.println("Server receive: " + string); return "hello " + string + " !"; } }
编写服务端代码
/** * Quick Start Server */public class QuickStartServer { public static void main(String[] args) { ServerConfig serverConfig = new ServerConfig() .setProtocol("bolt") // 设置一个协议,默认bolt .setPort(12200) // 设置一个端口,默认12200 .setDaemon(false); // 非守护线程 ProviderConfig<HelloService> providerConfig = new ProviderConfig<HelloService>() .setInterfaceId(HelloService.class.getName()) // 指定接口 .setRef(new HelloServiceImpl()) // 指定实现 .setServer(serverConfig); // 指定服务端 providerConfig.export(); // 发布服务 } }
编写客户端实现
/** * Quick Start client */public class QuickStartClient { public static void main(String[] args) { ConsumerConfig<HelloService> consumerConfig = new ConsumerConfig<HelloService>() .setInterfaceId(HelloService.class.getName()) // 指定接口 .setProtocol("bolt") // 指定协议 .setDirectUrl("bolt://127.0.0.1:12200"); // 指定直连地址 // 生成代理类 HelloService helloService = consumerConfig.refer(); while (true) { System.out.println(helloService.sayHello("world")); try { Thread.sleep(2000); } catch (Exception e) { } } } }
运行
分别启动服务端和客户端,观察运行效果。
服务端将打印:
Server receive: world
客户端将打印:
hello world !
小结
是不是发现,SOFA-RPC 与Dubbo、Motan 并无太大的区别。Dubbo 作为整套服务治理而存在,而 SOFA-RPC 只是一款轻量级的 RPC 框架,基于 HSF 框架改造,提供更加完善、强大的、多样化 RPC 编程 API。
最新版本v5.5.3发布内容
SOFARPC v5.5.3这是一个 Bug Fix 的版本,鼓励目前正在使用 5.5.x 版本的用户升级。
1、兼容性
没有不兼容问题
3、BUG 修复
- 修复特殊场景下路由重复的问题
- 兼容 Tracer 的采样标识
- 修复泛化调用再次重试的问题
This is nicely expressed! .
[url=https://theessayswriters.com/]write my nursing essay[/url] pro essay writer review [url=https://bestcheapessaywriters.com/]writing college essays[/url] i have nothing to write about for my college essay
Whoa tons of valuable data.
what can i write about for my essay write my essay for me cheap
Truly a lot of excellent knowledge.
pay someone to do your essay [url=https://seoqmail.com/]buy essay help[/url]
Terrific stuff, Cheers.
write my essay for me fast do my essay free
Wow all kinds of beneficial knowledge.
what makes a good writer essay write my college essay
Good content. Thanks.
play casino online real money [url=https://bestonlinecasinoreal.us/]casino nj online[/url] online casino money
Appreciate it! A good amount of material.
who can write my thesis for me write my resume for me
You actually suggested this perfectly!
write a research paper for me cheapest essay writer
Awesome material, Kudos!
[url=https://quality-essays.com/]order admission essay[/url] order of an essay [url=https://buyanessayscheaponline.com/]pay for paper[/url] buy custom essay online
Seriously plenty of wonderful tips!
[url=https://studentessaywriting.com/]paper writing services for college students[/url] essay on service [url=https://essaywritingserviceahrefs.com/]cheap essay writing[/url] best essay writer service
Point effectively regarded!.
[url=https://englishessayhelp.com/]help with an essay[/url] college application essay help [url=https://essaywritinghelperonline.com/]essaypro[/url] essay on the help
Really tons of helpful information.
[url=https://hireawriterforanessay.com/]best essay writers[/url] essay writer bot [url=https://theessayswriters.com/]write a conclusion for me[/url] make my essay
Kudos! Plenty of write ups.
[url=https://essaywritingservicelinked.com/]executive resume writing service[/url] linkedin profile writing service [url=https://essaywritingservicetop.com/]essay writing prompts[/url] essay writing service usa
Cheers! I appreciate this.
[url=https://customthesiswritingservice.com/]thesis help[/url] master thesis writing service uk [url=https://writingthesistops.com/]argumentative thesis[/url] thesis
Fantastic data. Thank you.
[url=https://essaywritingservicehelp.com/]best essay writing service review[/url] are essay writing services safe [url=https://essaywritingservicebbc.com/]writing a conclusion for an essay[/url] cheap essay writing service
You said it perfectly.!
[url=https://bestpaperwritingservice.com/]professional research paper writing services[/url] term paper writing service [url=https://bestonlinepaperwritingservices.com/]legit research paper writing services[/url] paper writing service review
With thanks! Ample forum posts!
[url=https://phdthesisdissertation.com/]help with dissertation writing[/url] dissertation research [url=https://writeadissertation.com/]masters dissertation help[/url] custom dissertation
Regards, I like it!
[url=https://quality-essays.com/]essay writer pay[/url] custom essays for sale [url=https://buyanessayscheaponline.com/]custom essay order[/url] buy argumentative essays online
You said it very well..
[url=https://writinganessaycollegeservice.com/]writing an expository essay[/url] paper writing services [url=https://essayservicehelp.com/]best finance essay writing service[/url] coursework writing service
Thanks a lot! Loads of posts.
[url=https://phdthesisdissertation.com/]dissertation research and writing[/url] doctoral dissertation help usa [url=https://writeadissertation.com/]dissertation uk[/url] dissertation help
Nicely put. Kudos!
[url=https://essaypromaster.com/]paper writer[/url] write a paper for me [url=https://paperwritingservicecheap.com/]research paper writers[/url] how to write a response paper
You revealed it wonderfully!
[url=https://quality-essays.com/]pay for someone to do your essay[/url] pay for a paper [url=https://buyanessayscheaponline.com/]pay for college essays[/url] college essays for sale
Many thanks. Loads of facts.
[url=https://ouressays.com/]thesis proposal[/url] research paper writer services [url=https://researchpaperwriterservices.com/]research paper writer[/url] thesis proposal
You have made your point!
[url=https://writingpaperforme.com/]write a paper for me[/url] write my paper reviews [url=https://custompaperwritersservices.com/]write a paper for me[/url] paper writing
Nicely put. Thanks a lot.
[url=https://essaypromaster.com/]how to write a philosophy paper[/url] essay writer review [url=https://paperwritingservicecheap.com/]how to write a response paper[/url] lined writing paper
With thanks. Loads of tips!
[url=https://essaywritingservicelinked.com/]essay writing courses online free[/url] article writing service [url=https://essaywritingservicetop.com/]help with college essay writing[/url] press release writing service
Reliable info. Many thanks!
[url=https://essayssolution.com/]write paper for me[/url] essay writer [url=https://cheapessaywriteronlineservices.com/]write paper for me[/url] best essay writers
You expressed it very well.
[url=https://theessayswriters.com/]write my research paper for me[/url] essay writter [url=https://bestcheapessaywriters.com/]ai essay writer[/url] essay writer
You definitely made the point.
[url=https://phdthesisdissertation.com/]dissertation writing help[/url] writing dissertations [url=https://writeadissertation.com/]dissertation proposal[/url] dissertation abstracts
Good data. Cheers.
[url=https://topswritingservices.com/]paper writing services[/url] write essay service [url=https://essaywriting4you.com/]college paper writing services[/url] top essay writing
Fine information. Cheers!
[url=https://helpwithdissertationwriting.com/]dissertations[/url] dissertation abstract [url=https://dissertationwritingtops.com/]dissertation writing[/url] dissertation writing services
You said it very well.!
[url=https://service-essay.com/]cheap research paper writing service[/url] cheap research paper writing service [url=https://custompaperwritingservices.com/]paper writing service reviews[/url] buy college paper
Thank you. An abundance of advice!
[url=https://bestpaperwritingservice.com/]paper help[/url] cheap research paper writing service [url=https://bestonlinepaperwritingservices.com/]buying papers for college[/url] pay someone to write your paper
Regards. Quite a lot of forum posts!
[url=https://service-essay.com/]pay for papers[/url] cheap research paper writing service [url=https://custompaperwritingservices.com/]order custom paper[/url] custom handwriting paper
Amazing info. Kudos!
[url=https://homeworkcourseworkhelps.com/]coursework[/url] reddit do my homework [url=https://helpmedomyxyzhomework.com/]reddit do my homework[/url] do my college homework
You mentioned that exceptionally well.
[url=https://essaywritingservicelinked.com/]essay writing practice[/url] college essays writing [url=https://essaywritingservicetop.com/]college paper writing service[/url] essay writing service coupon
Incredible tons of amazing advice!
[url=https://service-essay.com/]professional paper writing service[/url] buying papers for college [url=https://custompaperwritingservices.com/]pay someone to write paper[/url] best paper writing services
Appreciate it! A good amount of material!
[url=https://dissertationwritingtops.com/]dissertation paper[/url] phd dissertation help [url=https://helpwritingdissertation.com/]dissertation writing service[/url] custom dissertation writing services
You actually reported it fantastically!
[url=https://essaytyperhelp.com/]buy essay[/url] help writing essay [url=https://helptowriteanessay.com/]college application essay help[/url] the college essay guy
You revealed that perfectly!
[url=https://essayssolution.com/]write an essay for me[/url] essay writter [url=https://cheapessaywriteronlineservices.com/]write my research paper for me[/url] write my resume for me
Amazing all kinds of great knowledge!
[url=https://theessayswriters.com/]persuasive essay writer[/url] professional essay writers [url=https://bestcheapessaywriters.com/]writing essays[/url] essay writer review
You actually explained this very well!
[url=https://bestpaperwritingservice.com/]buy college paper[/url] paper writer services [url=https://bestonlinepaperwritingservices.com/]paper writing service[/url] buying papers for college
You actually revealed it effectively.
[url=https://essaywritingservicehelp.com/]college paper writing services[/url] personal essay writing service [url=https://essaywritingservicebbc.com/]essay paper writing service[/url] buy essay writing service
Regards! Very good information.
[url=https://dissertationwritingtops.com/]dissertations online[/url] custom dissertation writing services [url=https://helpwritingdissertation.com/]phd dissertation[/url] dissertation uk
Perfectly spoken certainly! !
[url=https://writingpaperforme.com/]pay someone to write my paper[/url] paper writer services [url=https://custompaperwritersservices.com/]how to write a philosophy paper[/url] essay writers online
Nicely put, Many thanks.
[url=https://studentessaywriting.com/]best essay writing service australia[/url] pro essay writing service [url=https://essaywritingserviceahrefs.com/]best resume writing service reddit[/url] seo article writing service
Really tons of wonderful facts.
[url=https://service-essay.com/]college paper writing service[/url] cheap research paper writing service [url=https://custompaperwritingservices.com/]custom handwriting paper[/url] custom handwriting paper
Great forum posts. Regards.
[url=https://bestpaperwritingservice.com/]research paper writing service[/url] buying papers for college [url=https://bestonlinepaperwritingservices.com/]custom paper[/url] custom handwriting paper
Truly a good deal of useful info!
[url=https://helpwithdissertationwriting.com/]dissertation uk[/url] dissertation data analysis help [url=https://dissertationwritingtops.com/]dissertation writer[/url] dissertation writer
Thanks a lot. A good amount of content!
[url=https://homeworkcourseworkhelps.com/]do my programming homework[/url] do my programming homework [url=https://helpmedomyxyzhomework.com/]do my chemistry homework[/url] do my homework
Terrific facts. Thanks!
[url=https://researchproposalforphd.com/]proposal introduction[/url] proposal writing [url=https://writingresearchtermpaperservice.com/]cheap research paper writing service[/url] research paper proposal
Nicely put. Thanks a lot.
[url=https://essaypromaster.com/]paper writing services[/url] essay writer [url=https://paperwritingservicecheap.com/]how to write a reaction paper[/url] kindergarten writing paper
Terrific information. Thank you!
[url=https://writinganessaycollegeservice.com/]essay writing service uk forum[/url] trusted essay writing service [url=https://essayservicehelp.com/]top essay writing service[/url] which essay writing service is the best
Incredible lots of amazing info.
[url=https://theessayswriters.com/]write my paper for me free[/url] write my essay for me [url=https://bestcheapessaywriters.com/]write an essay for me[/url] do my essay free
Valuable information. Thanks a lot.
[url=https://argumentativethesis.com/]phd thesis database[/url] write a thesis [url=https://bestmasterthesiswritingservice.com/]argumentative thesis statement[/url] writing a thesis
Truly all kinds of excellent information.
[url=https://essaypromaster.com/]pay someone to write a paper[/url] paper writing service [url=https://paperwritingservicecheap.com/]paper writer services[/url] pay to write paper
You said it perfectly.!
[url=https://englishessayhelp.com/]cheap essay help[/url] argumentative essay [url=https://essaywritinghelperonline.com/]help essay[/url] helping others essay
Many thanks! I like this!
[url=https://domyhomeworkformecheap.com/]i don t want to do my homework[/url] do my college homework [url=https://domycollegehomeworkforme.com/]homework help[/url] pay to do my homework
Kudos! Fantastic stuff.
[url=https://essaytyperhelp.com/]essay writing service[/url] paperhelp [url=https://helptowriteanessay.com/]help writing essay[/url] college application essay help
Cheers! Loads of data!
[url=https://payforanessaysonline.com/]pay someone to write my college essay[/url] pay someone to write your paper [url=https://buycheapessaysonline.com/]pay for essay online[/url] pay for essay papers
Effectively spoken really. !
[url=https://phdthesisdissertation.com/]writing dissertations[/url] dissertation writing help [url=https://writeadissertation.com/]dissertation service[/url] dissertation writer
Nicely put. Regards.
[url=https://quality-essays.com/]pay for paper[/url] pay for paper [url=https://buyanessayscheaponline.com/]essays for sale[/url] pay to write essay
Cheers. Numerous facts!
[url=https://dissertationwritingtops.com/]definition of dissertation[/url] dissertation assistance [url=https://helpwritingdissertation.com/]writing dissertation[/url] dissertations
Nicely put, Appreciate it!
[url=https://essaywritingservicehelp.com/]custom essay writing[/url] cheap reliable essay writing service [url=https://essaywritingservicebbc.com/]admission essay writing service[/url] writing a personal essay
You reported it exceptionally well.
[url=https://argumentativethesis.com/]thesis statement[/url] how to write thesis [url=https://bestmasterthesiswritingservice.com/]doctoral thesis[/url] working thesis
Really all kinds of helpful facts.
essaytyper essay helper free
[url=https://homeworkcourseworkhelps.com/]homework help[/url] do my programming homework [url=https://helpmedomyxyzhomework.com/]should i do my homework[/url] hire someone to do my homework
copywriting service
Many thanks, Wonderful stuff.
cheap paper writers my paper writer
Fine stuff. Thanks.
writers of the federalist papers how to write a reflection paper
[url=https://domyhomeworkformecheap.com/]do my homework for money[/url] hire someone to do my homework [url=https://domycollegehomeworkforme.com/]do my math homework[/url] my homework
website content writing services
You actually expressed that effectively.
[url=https://theessayswriters.com/]write my essay for cheap[/url] write this essay for me [url=https://bestcheapessaywriters.com/]write my essay for me free[/url] online essay writer
Great forum posts. Thanks a lot.
custom handwriting paper paper writing service
Nicely put, Cheers!
phd paper dissertation writing services reviews
Very good stuff. Cheers.
[url=https://bestpaperwritingservice.com/]buy college paper[/url] cheap research paper writing service [url=https://bestonlinepaperwritingservices.com/]order custom paper[/url] college paper writing service
Appreciate it, Loads of stuff.
help with college essay writing writing essay services
You explained this exceptionally well!
[url=https://researchproposalforphd.com/]research paper proposal[/url] termpaper [url=https://writingresearchtermpaperservice.com/]proposal writer[/url] research paper writer services
Many thanks, Fantastic information.
proposal research research paper writers
[url=https://essaywritingservicehelp.com/]buy essay writing service[/url] best online essay writing services reviews [url=https://essaywritingservicebbc.com/]paper writing service college[/url] college application essay writing service
graduation thesis
Thank you! Ample data!
writing a dissertation writing help
You actually expressed this effectively.
dissertation writers dissertation help services
[url=https://domyhomeworkformecheap.com/]homework help cpm[/url] homework [url=https://domycollegehomeworkforme.com/]homework help cpm[/url] do my homework for me
contractions in college essays
You actually explained it really well!
[url=https://quality-essays.com/]buy essay online[/url] pay to write my essay [url=https://buyanessayscheaponline.com/]buy essay[/url] pay someone to write your paper
You stated it superbly.
essay writing courses online free essay writers service
Well voiced indeed! !
writing a descriptive essay best online essay writing service
[url=https://bestpaperwritingservice.com/]buy a paper for college[/url] custom paper [url=https://bestonlinepaperwritingservices.com/]college paper writing service[/url] paper writing service
book review writers
Amazing facts. Appreciate it.
[url=https://essaywritingservicehelp.com/]top ten essay writing services[/url] essay writing service [url=https://essaywritingservicebbc.com/]best essay writing service australia[/url] writing service essay
Amazing lots of valuable advice!
essay writer free trial writing a personal essay
Cheers, I value this!
thesis titles argumentative thesis
[url=https://ouressays.com/]research proposal cover page[/url] research proposals [url=https://researchpaperwriterservices.com/]custom research paper writing services[/url] online proposal
mba dissertation
Truly plenty of useful material.
[url=https://englishessayhelp.com/]essay helper online[/url] helping others essay [url=https://essaywritinghelperonline.com/]help essay[/url] help essay
Really all kinds of terrific advice!
thesis statements a good thesis statement
With thanks. Lots of posts.
essay writer review write me an essay
[url=https://essaypromaster.com/]ai essay writer[/url] writing a paper [url=https://paperwritingservicecheap.com/]online essay writer[/url] write my research paper for me
application essay writing service
You suggested it superbly!
[url=https://domyhomeworkformecheap.com/]do my homework for me[/url] cpm homework help [url=https://domycollegehomeworkforme.com/]do my homework[/url] my homework
Truly loads of amazing tips!
writing a good essay personal essay writing service
Appreciate it, A lot of facts!
research paper writers write my term paper
[url=https://theessayswriters.com/]persuasive essay writer[/url] write paper for me [url=https://bestcheapessaywriters.com/]online essay writers[/url] write my paper for me
i need help writing an essay
With thanks! Loads of posts.
[url=https://essaytyperhelp.com/]essaytyper[/url] the college essay guy [url=https://helptowriteanessay.com/]free writing assistant[/url] essay writing help
Awesome forum posts. Thanks a lot!
help me write my essay essay help
You stated that really well.
college essays writing writing essay
[url=https://customthesiswritingservice.com/]thesis statements[/url] thesis writing [url=https://writingthesistops.com/]working thesis[/url] thesis template
dissertation writing tips
Thanks. Terrific stuff.
[url=https://essaywritingservicehelp.com/]best resume writing service reddit[/url] writing a scholarship essay [url=https://essaywritingservicebbc.com/]online essay writing[/url] executive resume writing service
You said it superbly.
buy research paper termpaper
[url=https://argumentativethesis.com/]thesis titles[/url] a thesis [url=https://bestmasterthesiswritingservice.com/]example thesis[/url] good thesis statements
custom essays services
Cheers! I value this!
[url=https://topswritingservices.com/]admission essay writing service[/url] essay writing service coupon [url=https://essaywriting4you.com/]essay review service[/url] writing essays online
Superb data. Regards.
do my homework for free do my homework for money
You actually reported that adequately!
custom paper buy college paper
[url=https://researchproposalforphd.com/]buy term papers online[/url] buy a research paper [url=https://writingresearchtermpaperservice.com/]research paper writer services[/url] research proposals
how to write a essay introduction
Well expressed truly. !
[url=https://bestpaperwritingservice.com/]pay for research paper[/url] paper writing service reviews [url=https://bestonlinepaperwritingservices.com/]best college paper writing service[/url] graduate paper writing service
This is nicely expressed. .
essay writers online lined writing paper
Terrific material. Thanks!
buying papers for college pay for papers
[url=https://topswritingservices.com/]urgent essay writing service[/url] online check writing service [url=https://essaywriting4you.com/]essay writing help[/url] writing essays online
ivy league college essays
Really a good deal of excellent data.
[url=https://customthesiswritingservice.com/]thesis writing[/url] good thesis [url=https://writingthesistops.com/]college thesis[/url] working thesis
You said it adequately.!
do my homework for me pay to do my homework
Kudos, Loads of tips!
custom handwriting paper pay to write paper
[url=https://homeworkcourseworkhelps.com/]xyz homework[/url] do my math homework [url=https://helpmedomyxyzhomework.com/]homework[/url] online coursework
writing a argumentative essay
Cheers! Excellent information.
argumentative thesis statement writing a thesis
Useful forum posts. Thanks a lot.
[url=https://englishessayhelp.com/]essay writing service[/url] need help writing an essay [url=https://essaywritinghelperonline.com/]essay help[/url] help essay
With thanks! Numerous forum posts!
buy essay service essay writing service reviews
[url=https://dissertationwritingtops.com/]dissertation assistance[/url] dissertation writing help [url=https://helpwritingdissertation.com/]dissertation definition[/url] dissertation writing services reviews
book writing help
Thanks. Ample write ups.
best essay writing service reddit are essay writing services safe
This is nicely put. !
[url=https://writingpaperforme.com/]writers of the federalist papers[/url] write my research paper for me [url=https://custompaperwritersservices.com/]online essay writer[/url] paper writing services