rpc

Examples of the best SOAP/REST/RPC web APIs? And why do you like them? And what's wrong with them? [closed]

旧城冷巷雨未停 提交于 2019-11-28 15:03:53
At my company we're starting to branch into web APIs to access and update our data; initially for partners but then likely to the public in future. At the moment the way the API will look (e.g. SOAP, REST, RPC) is completely open and we haven't made any decisions yet, so I'm interested in both examples of web APIs people think are good, and why you think that. What I'm interested in is opinions from people using different languages (we're likely to be offering the API to people using a number of platforms, particularly including .NET, Java, ActionScript and JavaScript) about web APIs that you

What is the difference between Java RMI and RPC?

本小妞迷上赌 提交于 2019-11-28 15:02:51
What is the actual difference between Java RMI and RPC? I have read in some places that RMI uses Objects? fortran RPC is C based, and as such it has structured programming semantics, on the other side, RMI is a Java based technology and it's object oriented. With RPC you can just call remote functions exported into a server, in RMI you can have references to remote objects and invoke their methods, and also pass and return more remote object references that can be distributed among many JVM instances, so it's much more powerful. RMI stands out when the need to develop something more complex

微服务学习之路(五)——追踪微服务调用

旧时模样 提交于 2019-11-28 15:02:04
追踪微服务调用的背景——快速定位服务调用失败的原因。 除此还有如下几个作用: 一、优化系统瓶颈   通过记录调用经过的每一条链路上的耗时,快速定位整个系统的瓶颈所在,做出针对性的优化。 二、优化链路调用   通过服务追踪可以分析调用所经过的路径,然后评估是否合理。比如一个服务调用下游依赖了多个服务,通过链路分析,可以评估是否每个依赖都是必须的,是否可以通过优化业务来减少服务依赖。 三、生成网络拓扑   通过服务追踪系统中记录的链路信息,可以生成一张系统的网络拓扑调用图,反应系统依赖了哪些服务,以及服务之间的调用的关系是什么样的。在网络拓扑图上还可以把服务调用的详细信息标出来,起到服务监控作用。 四、透明传输数据   除了服务追踪,业务上还经常与一种需求,期望把用户数据,从调用的开始一直往下传,以便系统中各个服务都能获取到这个信息。比如业务想做一些A/B测试,这时候能通过服务追踪系统,把A/B测试的开关逻辑一直往下传递,经过的每一层服务都能获取到这个开关值,就能够统一进行A/B测试。   服务追踪系统原理 核心理念:通过全局唯一ID将分布在各个服务节点上的同一次请求串联起来,从而还原原有的调用关系,可以追踪系统问题、分析调用数据并统计各个系统指标。(Google一篇论文——Dapper) 由此衍生出:Twitter的Zipkin、阿里的鹰眼、美团MTrace(如下图)等   

Unmarshal to a interface type

与世无争的帅哥 提交于 2019-11-28 14:49:00
I have some code I've been dumped with and am actually stumped - I've worked with RPC and the JSON side of things before but I can't seem to get it to work over RPC when it works fine locally. package main import ( "log" "net" "net/rpc" "net/rpc/jsonrpc" "reflect" ) type Foo interface { SayHello() error } type fakeFoo struct { internalValue string } func NewFakeFoo() *fakeFoo { f := &fakeFoo{} f.internalValue = "123456789012347" return f } func (m *fakeFoo) SayHello() error { return nil } type FooManager struct { availableFoos []Foo } func NewFooManager() *FooManager { p := new(FooManager) p

Android: Passing a Service a Handler

老子叫甜甜 提交于 2019-11-28 13:56:22
So, I've read the android AIDL documentation and have a general idea of how RPC works between an Activity and a Service. However, for my application it seems overboard to implement such features: basically, I want to pass a Service a nice handler so its thread can pass data to my Activity. Currently I'm getting around this by using a static public member (a hack) but I would prefer just passing a Handler object in the Service's starting Intent. E.g. I can easily pass ints to my service upon creation: int x = 0; Intent svc = new Intent(this, MyService.class); svc.putExtra("x",x); startService

Web service differences between REST and RPC

坚强是说给别人听的谎言 提交于 2019-11-28 13:28:40
问题 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? 回答1: 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

go RPC 远程调用

喜你入骨 提交于 2019-11-28 13:21:59
Go语言 中 RPC(Remote Procedure Call,远程过程调用)是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络细节的应用程序通信协议。RPC 协议构建于 TCP 或 UDP ,或者是 HTTP 之上,允许开发者直接调用另一台计算机上的程序,而开发者无需额外地为这个调用过程编写网络通信相关代码,使得开发包括网络分布式程序在内的应用程序更加容易。 RPC 采用客户端—服务器(Client/Server)的工作模式。请求程序就是一个客户端(Client),而服务提供程序就是一个服务器(Server)。当执行一个远程过程调用时,客户端程序首先发送一个带有参数的调用信息到服务端,然后等待服务端响应。 在服务端,服务进程保持睡眠状态直到客户端的调用信息到达为止。当一个调用信息到达时,服务端获得进程参数,计算出结果,并向客户端发送应答信息,然后等待下一个调用。最后,客户端接收来自服务端的应答信息,获得进程结果,然后调用执行并继续进行。 在 Go 中,标准库提供的 net/rpc 包实现了 RPC 协议需要的相关细节,开发者可以很方便地使用该包编写 RPC 的服务端和客户端程序,这使得用 Go语言开发的多个进程之间的通信变得非常简单。 net/rpc 包允许 RPC 客户端程序通过网络或是其他 I/O 连接调用一个远端对象的公开方法(必须是大写字母开头、可外部调用的

Dubble 01 架构模型&start project

余生长醉 提交于 2019-11-28 11:59:46
Dubbo 01 架构模型 传统架构 All in One 测试麻烦,微小修改 全都得重新测 单体架构也称之为单体系统或者是单体应用。就是一种把系统中所有的功能、模块耦合在一个应用中的架构方式。其优点为:项目易于管理、部署简单。缺点:测试成本高、可伸缩性差、可靠性差、迭代困难、跨语言程度差、团队协作难 聚合项目划分 单项目容易 因为某个功能导致整体oom 拆分完 咋实现 SOA 架构: Service-Oriented Architecture 面向服务的架构(SOA)是一个组件模型,它将应用程序拆分成不同功能单元(称为服务)通过这些服务之间定义良好的接口和契约联系起来。接口是采用中立的方式进行定义的,它应该独立于实现服务的硬件平台、操作系统和编程语言。这使得构建在各种各样的系统中的服务可以以一种统一和通用的方式进行交互。 在没有实施SOA的年代,从我们研发的角度来看,只能在代码级别复用,即Ctrl +V。SOA出现,我们开始走向了模块、业务线的复用。 SOA年代的典型实现: SOAP协议,CXF框架,XML传输 xsd,数据校验 SOA架构伴随着软件研发行业20年的发展,在最初的时候,大型it公司内部系统规模越来越大,IT系统越来越复杂,All in One单体架构的思想导致公司内项目业务和数据相互隔离,形成了孤岛。 最初,我们使用数据库作为项目之间数据交互和中转的平台

midl cannot find C preprocessor cl.exe

本小妞迷上赌 提交于 2019-11-28 09:41:58
问题 I am trying to compile my arith.idl file with midl. I am running windows 7 pro. Here is the command I launch in a powershell prompt: PS> 'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\midl.exe' .\arith.idl Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0555 Copyright (c) Microsoft Corporation. All rights reserved. 64 bit Processing .\arith.idl midl : command line error MIDL1005 : cannot find C preprocessor cl.exe PS> I am quite a noob at windows RPC programming, I would highly

Linux下NFS服务器的搭建与配置

社会主义新天地 提交于 2019-11-28 09:38:55
一、NFS服务简介  NFS 就是 N etwork F ile S ystem 的缩写,最早之前是由sun 这家公司所发展出来的。 它最大的功能就是 可以透过网络,让不同的机器、不同的操作系统、可以彼此分享个别的档案 (share files)。所以,你也可以简单的将他看做是一个文件服务器 (file server) 呢!这个 NFS 服务器可以让你的 PC 来将网络远程的 NFS 服务器分享的目录,挂载到本地端的机器当中, 在本地端的机器看起来,那个 远程主机的目录就好像是自己的一个磁盘分区槽一样 (partition)!使用上面相当的便利! 因为 NFS 支持的功能相当的多,而不同的功能都会使用不同的程序来启动, 每启动一个功能就会启用一些端口来传输数据,因此, NFS 的功能所对应的端口才没有固定住, 而是随机取用一些未被使用的小于 1024 的埠口来作为传输之用。但如此一来又造成客户端想要连上服务器时的困扰, 因为客户端得要知道服务器端的相关埠口才能够联机吧! 此时我们就得需要远程过程调用 (RPC) 的服务啦! RPC 最主要的功能就是在指定每个 NFS 功能所对应的 port number ,并且回报给客户端,让客户端可以连结到正确的埠口上去。 那 RPC 又是如何知道每个 NFS 的埠口呢?这是因为 当服务器在启动 NFS 时会随机取用数个埠口,并主动的向 RPC