rpc

dubbo源码分析系列——dubbo-rpc-api模块源码分析

限于喜欢 提交于 2019-11-30 01:41:32
简化的类图 该图是经过简化后的rpc-api模块的类图,去除了一些非关键的属性和方法定义,也去除了一些非核心的类和接口,只是一个简化了的的示意图,这样大家能够去除干扰看清楚该模块的核心接口极其关系, 请点击看大图更清晰一些 。 核心类说明 Protocol 服务协议。这是rpc模块中最核心的一个类,它定义了rpc的最主要的两个行为即:1、provider暴露远程服务,即将调用信息发布到服务器上的某个URL上去,可以供消费者连接调用,一般是将某个service类的全部方法整体发布到服务器上。2、consumer引用远程服务,即根据service的服务类和provider发布服务的URL转化为一个Invoker对象,消费者可以通过该对象调用provider发布的远程服务。这其实概括了rpc的最为核心的职责,提供了多级抽象的实现、包装器实现等。 AbstractProtocol Protocol的顶层抽象实现类,它定义了这些属性:1、exporterMap表示发布过的serviceKey和Exporter(远程服务发布的引用)的映射表;2、invokers是一个Invoker对象的集合,表示层级暴露过远程服务的服务执行体对象集合。还提供了一个通用的服务发布销毁方法destroy,该方法是一个通用方法,它清空了两个集合属性,调用了所有invoker的destroy方法

RPC原理及实现

岁酱吖の 提交于 2019-11-29 23:42:01
#0 系列目录# 聊聊远程通信 Java远程通讯技术及原理分析 聊聊Socket、TCP/IP、HTTP、FTP及网络编程 RMI原理及实现 RPC原理及实现 轻量级分布式 RPC 框架 使用 RMI + ZooKeeper 实现远程调用框架 深入浅出SOA思想 微服务、SOA 和 API对比与分析 聊聊同步、异步、阻塞与非阻塞 聊聊Linux 五种IO模型 聊聊IO多路复用之select、poll、epoll详解 聊聊C10K问题及解决方案 #1 简介# RPC 的主要功能 目标是让构建分布式计算(应用)更容易 ,在提供强大的远程调用能力时不损失本地调用的语义简洁性。为实现该目标,RPC 框架需提供一种透明调用机制让使用者 不必显式的区分本地调用和远程调用 。 #2 调用分类# RPC 调用分以下两种: 同步调用 客户方等待调用执行完成并返回结果。 异步调用 客户方调用后不用等待执行结果返回,但依然可以通过回调通知等方式获取返回结果。 若客户方不关心调用返回结果,则变成单向异步调用,单向调用不用返回结果。 异步和同步的区分在于是否等待服务端执行完成并返回结果 。 #3 结构拆解# RPC 服务方通过 RpcServer 去导出(export)远程接口方法 ,而 客户方通过 RpcClient 去引入(import)远程接口方法 。 客户方像调用本地方法一样去调用远程接口方法,

How can I call a GWT RPC method on a server from a non GWT (but Java) gapplication?

感情迁移 提交于 2019-11-29 23:18:29
I have a regular Java application and want to access an GWT RPC endpoint. Any idea how to make this happen? My GWT application is on a GAE/J and I could use REST for example but I already have the GWT RPC endpoints and don't want to build another façade. Yes, I have seen Invoke a GWT RPC service from Java directly , but this discussion goes into a different direction. GWT SyncProxy allows you to access GWT RPC services (e.g methods) from pure Java (not JSNI) code. See http://www.gdevelop.com/w/blog/2010/01/10/testing-gwt-rpc-services/ for details. The Java implementation in GWT of the RPC

C/C++ RPC Tutorial for Linux [closed]

柔情痞子 提交于 2019-11-29 22:36:39
Can someone point me to a decent RPC tutorial for (or books) linux, like in this post. I tried looking around myself, I've only found tutorials that are really old. Thanks Since the idea of RPC goes back to 1976 and the first business use was by Xerox in 1981, I'm not exactly sure what qualifies as a really old tutorial. Here are a few resources you might find helpful. Power Programming with RPC (1992) Remote Procedure Calls | Linux Journal (Oct 01, 1997) Remote Procedure Calls (RPC) (1999) Remote Procedure Call Programming Guide (PDF link) rpc(3) - Linux man page 来源: https://stackoverflow.com

微服务环境搭建SpringCloud

亡梦爱人 提交于 2019-11-29 22:21:52
                         微服务环境搭建SpringCloud 1.什么是单体应用:    单体应用项目中的资源都在一个应用中,打包成一个war包,用一个tomcat启动的服务就是单体应用    单体应用的好处:       (1)小的项目性能比微服务的性能高       (2)集成快,适合数据量小的项目,比如内部自己用的项目    单体应用的坏处:       (1)一个模块挂了,整个项目都受影响       (2)单个tomcat更能处理的并发有限,可以做集群,但是不方便局部(某一个模块)扩展       (3)维护/开发/升级比较麻烦       (4)代码臃肿,编译,打包都比较慢       (5)技术选型单一       (6)数据库选型单一    2.什么是微服务:   微服务就是把一个大的系统拆分成多个小的服务,每个服务只专注自己的一个业务,每个服务有各自的进程  微服务之间使用的网络通信协议进行数据交换的(通常是基于HTTP的RESTful API) 3.微服务的远程调用方式:   1.RPC     (1).Remote Produce Call 远程过程调用,类似的还有 RMI 。 自定义数据格式,基于原生 TCP 通信,速度快,效率高 。早期的 webservice ,现在热门的 dubbo ,都是 RPC 的典型    2.Http

TCP-based RPC server (Erlang or something similar?) for iOS/Android app communication

萝らか妹 提交于 2019-11-29 21:32:43
I'm building native mobile applications in both iOS and Android. These apps require "realtime" updates from and to the server, same as any other network-based application does (Facebook, Twitter, social games like Words with Friends, etc) I think using HTTP long polling for this is over kill in the sense that long polling can be detrimental to battery life, especially with a lot of TCP setup/teardown. It might make sense to have the mobile applications use persistent TCP sockets to establish a connection to the server, and send RPC style commands to the server for all web service communication

zz 花了一个星期,我终于把RPC框架整明白了!

耗尽温柔 提交于 2019-11-29 21:14:01
https://www.jianshu.com/p/193634cca86a RPC(Remote Procedure Call):远程过程调用,它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的思想。 RPC 是一种技术思想而非一种规范或协议,常见 RPC 技术和框架有: 应用级的服务框架:阿里的 Dubbo/Dubbox、Google gRPC、Spring Boot/Spring Cloud。 远程通信协议:RMI、Socket、SOAP(HTTP XML)、REST(HTTP JSON)。 通信框架:MINA 和 Netty。 目前流行的开源 RPC 框架还是比较多的,有阿里巴巴的 Dubbo、Facebook 的 Thrift、Google 的 gRPC、Twitter 的 Finagle 等。 下面重点介绍三种: gRPC:是 Google 公布的开源软件,基于最新的 HTTP 2.0 协议,并支持常见的众多编程语言。RPC 框架是基于 HTTP 协议实现的,底层使用到了 Netty 框架的支持。 Thrift:是 Facebook 的开源 RPC 框架,主要是一个跨语言的服务开发框架。 用户只要在其之上进行二次开发就行,应用对于底层的 RPC 通讯等都是透明的。不过这个对于用户来说需要学习特定领域语言这个特性,还是有一定成本的。 Dubbo

Socket Exception: “There are no more endpoints available from the endpoint mapper”

醉酒当歌 提交于 2019-11-29 19:30:14
问题 I am using winsock and C++ to set up a server application. The problem I'm having is that the call to listen results in a first chance exception. I guess normally these can be ignored (?) but I've found others having the same issue I am where it causes the application to hang every once in a while. Any help would be greatly appreciated. The first chance exception is: First-chance exception at 0x*12345678* in MyApp .exe: 0x000006D9: There are no more endpoints available from the endpoint

【2016-05-08】Jersey vs. SpringMVC

痞子三分冷 提交于 2019-11-29 19:13:38
当前Web Service 常用的风格有两种,RESTful风格和RPC风格。 一、RESTful与RPC简介 RPC的中心是方法,REST的中心是资源。 RPC: 其中RPC风格中常见的有XML-RPC和JSON-RPC,JSON以其简洁、传输高效见长。 RESTful: 如果一个Web Service满足REST的几个条件,那么就称他们是RESTful的。 这里提到的条件包括:(来自参考资料1) C/S结构 (这是Internet服务的一个基本特征) 无状态 (很熟悉吧,呵呵) 可以cache (想起了浏览器?) 分层系统 (想起了无数的架构?) 统一的接口 (如果这是可能的,程序员有福了, :D) code on demand(可选, 其实是一种扩展性的要求) 以上几个特征和HTTP如此相像, RESTful之于RPC之优点:(来自参考资料1) 根据经验,建议能够使用REST就尽量使用REST, 主要基于下面几个考虑: 易扩展 松耦合(意味着,不用强制要求客户端去更新相应的代码) 客户端实现语言无关 性能 安全性(例如HTTPS) 当然上述的几点也并非 RPC 都不满足,不过相对而言, REST 更加清晰和简洁, 再辅以 JSON 相应的服务会在性能和稳定性(简单通常意味着robust)方面有很大的提高. 二、Jersey与SpringMVC比较

Web service differences between REST and RPC

こ雲淡風輕ζ 提交于 2019-11-29 18:45:58
I have a web service that accepts JSON parameters and have specific URLs for methods, e.g.: http://IP:PORT/API/getAllData?p={JSON} This is definitely not REST as it is not stateless. It takes cookies into account and has its own session. Is it RPC? What is the difference between RPC and REST? Bogdan You can't make a clear separation between REST or RPC just by looking at what you posted. One constraint of REST is that it has to be stateless. If you have a session then you have state so you can't call your service RESTful. The fact that you have an action in your URL (i.e. getAllData ) is an