rpc

How to set rpc timeout in thrift python client?

有些话、适合烂在心里 提交于 2019-12-07 04:59:01
问题 I'm writing python client using thrift, but I can't find any available option to set rpc time out. My client code goes below: socket = TSocket.TSocket(address, port) transport = TTransport.TBufferedTransport(socket) protocol = TBinaryProtocol.TBinaryProtocol(transport) server = Client.Client(protocol) transport.open() 回答1: You can use socket.setTimeout() method. from thrift.transport.THttpClient import THttpClient socket = THttpClient(server_url) socket.setTimeout(SERVICE_TIMEOUT_IN_mS)

Determining the COM object blocking finalizer

心不动则不痛 提交于 2019-12-07 03:11:46
问题 We have a .NET background processing application (console app) that executes some arbitrary workloads (basically internal users supply .NET DLLs implementing "Execute" interface). Background processing application then loads the dll via reflection and executes it. One of the supplied DLLs apparently has a COM object in it which is not properly disposed (likely). As the processing time is quite long, AND we have COM objects created on the main thread and not disposed properly, this causes a

Which Java RMI/RPC/IPC technology should I use?

人走茶凉 提交于 2019-12-07 03:07:59
问题 I'm developing a Java application that consists of a server and a client (possibly multiple clients in future) which may run on different hosts. For communication between these two I currently use a custom protocol which consists of JSON messages that are sent over network sockets and that are converted back to Java Bean objects on both sides. However the more complex the application gets I notice that this method doesn't meet my standards and is too complex. I'm looking for a well

GWT & XSRF Protection

拜拜、爱过 提交于 2019-12-07 02:06:21
问题 I'm looking at possible solutions to protect my GWT app against XSRF. If I understand GWT's solution correctly - it makes available a Servlet which you use to both generate the token on the client-side (when calling your RPC endpoint) and to validate on the server-side (when the call hits your service). Does this solution only cater for RPC calls? Surely we need it to cover all user generated requests to the server? Any other recommended XSRF solutions (I'm also looking at OWASP's CSRFGuard)?

Play! Akka Flume实现的完整数据收集

徘徊边缘 提交于 2019-12-06 18:59:15
前言 现如今,大数据如火如荼。针对用户行为,用户喜好等后续大数据分析也是十分火热。这个小项目实现了后台数据收集的一系列完整流程。 项目总体流程以及用到的技术 Play ! 作为web服务器,使用RESTful 规范编写接口(客户端事先埋点,然后调用接口上传数据) Play !接口接受到的记录(json形式)经过处理后,先保存到 concurrentQueue中 Play! 启动后,start一个Akka schedulable actor.他每隔一段时间,让子actor去poll queue中的数据 调用flume的封装的rpc,将数据发送到指定的端口。 Flume source端接收数据,按照配置重定向数据,sink到console. 3. 后台实现 3.1 编写接口 采用RESTful编写接口,首先在play! 的conf中routes定义接口: #run log POST /events/runlogs controllers.RunLogs.create() 然后编写controller public static Result create(){ JsonNode js = request().body().asJson(); RunLog.create(js); //return ok anyway return ok(); } 然后是model public

Which RPC Library is best and Official for Openerp?

百般思念 提交于 2019-12-06 17:27:08
I found some RPC Library (Python) for driving Odoo/OpenERP. openerplib oerplib erppeek xmlrpclib odoorpc Please let me know, which one is Best/Good/Official? Thanks in advance openerplib is a PHP library, probably not what you want if you're planning to use Pyhton. xmlrpclib is Python standard library for XML-RPC. You can perfectly work with it, but it won't be the most pleasant library to work with. See the official docs for more details on it. The other libraries are wrappers around xmlrpclib . oerplib and odoorpc are from the same author, and I believe that the former is an older version

Dubbo 学习笔记(零) 自己实现一个 RPC 框架

ε祈祈猫儿з 提交于 2019-12-06 15:19:29
Dubbo 学习笔记 源码地址 Dubbo 学习笔记(零) 自己实现一个 RPC 框架 Dubbo 学习笔记(一) Hello,Dubbo Dubbo 学习笔记(二) Spring Boot 整合 Dubbo Dubbo 学习笔记(三) Spring Boot 整合 Dubbo(官方版) 0. 什么是 RPC 框架 RPC(Remote Procedure Call) 是一种进程间的通信方式。允许像调用本地服务一样调用远程服务。 简单点说,它是一种通信方式,它的功能就是让你像调用本地服务(函数、方法)一样,调用远程服务(函数,方法)。 比如说,我在服务端有一个接口 (MyService.sayHello())。传统的调用方式是,我们暴露一个 Controller 并绑定到对应的 url地址上,然后通过 http 请求,将参数发送给远程服务器,服务器执行结束后,将结果响应给客户端。 而 RPC 调用方式是,我在客户端导入 MyService 的接口,直接用 MyService.sayHello() 去调用。注意:客户端并没有直接的创建该接口的具体实现对象。而是通过 RPC 的通信方式去来与服务端交互。 1. RPC 框架的基本原理 RPC 框架的基本原理是通过 Socket 和对象序列化来实现的。 首先,客户端和服务端通过 Socket 来建立通信,客户端将需要调用的接口

第4章 集成

 ̄綄美尐妖づ 提交于 2019-12-06 15:13:58
在我看来,集成是微服务相关技术中最重要的一个。做得好的话,你的微服务可以保持自 治性,你也可以独立地修改和发布它们;但做得不好的话会带来灾难。希望本章能够帮助 你在微服务之旅中,避免曾经在SOA中遇到的那些问题。 4.1寻找理想的集成技术 微服务之间通信方式的选择非常多样化,但哪个是正确的呢? SOAP? XML-RPC ? REST? Protocol Buffers ?后面会逐一讨论,但是在此之前需要考虑的是,我们到底希望 从这些技术中得到什么。 4.1.1避免破坏性修改 有时候,对某个服务做的一些修改会导致该服务的消费方也随之发生改变。后面会讨论如 何处理这种情形,但是我们希望选用的技术可以尽量避免这种情况的发生。比如,如果一 个微服务在一个响应中添加了一个字段,那么已有的消费方不应该受到影响。 4.1.2保证API的技术无关性 我很喜欢保持开放的心态,这也正是我喜欢微服务的原因。因此我认为,保证微服务之间 通信方式的技术无关性是非常重要的。这就意味着,不应该选择那种对微服务的具体实现 技术有限制的集成方式。 4.1.3使你的服务易于消费方使用 消费方应该能很容易地使用我们的服务。如果消费方使用该服务比登天还难,那么无论该 微服务多漂亮都没有任何意义。所以让我们考虑一下,如何让消费方简便地使用美妙的新 服务。理想情况下,消费方应该可以使用任何技术来实现,从另一方面来说

Can Java objects be accessed from Javascript in GWT?

坚强是说给别人听的谎言 提交于 2019-12-06 14:27:34
问题 My goal is to initiate RPC calls directly from javascript. I have come up with ways to fake callbacks (because of the asynchronous nature of RPC) but I can't figure out how to get custom objects into javascript. So, I've created a class named Interop and I statically create the service I'm interested in (had to use static as it was all I could get working, I don't think it's relevant right now): public class Interop { private static final GreetingServiceAsync service = GWT.create

Dubbo 学习笔记(零) 自己实现一个 RPC 框架

巧了我就是萌 提交于 2019-12-06 13:04:19
Dubbo 学习笔记 源码地址 Dubbo 学习笔记(零) 自己实现一个 RPC 框架 Dubbo 学习笔记(一) Hello,Dubbo Dubbo 学习笔记(二) Spring Boot 整合 Dubbo Dubbo 学习笔记(三) Spring Boot 整合 Dubbo(官方版) 0. 什么是 RPC 框架 RPC(Remote Procedure Call) 是一种进程间的通信方式。允许像调用本地服务一样调用远程服务。 简单点说,它是一种通信方式,它的功能就是让你像调用本地服务(函数、方法)一样,调用远程服务(函数,方法)。 比如说,我在服务端有一个接口 (MyService.sayHello())。传统的调用方式是,我们暴露一个 Controller 并绑定到对应的 url地址上,然后通过 http 请求,将参数发送给远程服务器,服务器执行结束后,将结果响应给客户端。 而 RPC 调用方式是,我在客户端导入 MyService 的接口,直接用 MyService.sayHello() 去调用。注意:客户端并没有直接的创建该接口的具体实现对象。而是通过 RPC 的通信方式去来与服务端交互。 1. RPC 框架的基本原理 RPC 框架的基本原理是通过 Socket 和对象序列化来实现的。 首先,客户端和服务端通过 Socket 来建立通信,客户端将需要调用的接口