thrift

Symmetric encryption (AES) in Apache Thrift

不打扰是莪最后的温柔 提交于 2019-12-03 21:27:45
I have two applications that interact using Thrift. They share the same secret key and I need to encrypt their messages. It makes sense to use symmetric algorithm (AES, for example), but I haven't found any library to do this. So I made a research and see following options: Use built-in SSL support I can use built-in SSL support, establish secure connection and use my secret key just as authentication token. It requires to install certificates in addition to the secret key they already have, but I don't need to implement anything except checking that secret key received from client is the same

我的第3个开源软件:MyThrift

纵饮孤独 提交于 2019-12-03 20:39:31
http://git.oschina.net/qiangzigege/MyThrift 基于以下组件打造的一款轻量级RPC服务框架:thrift(facebook出品)、commons-pool(socket连接池)、自研服务治理框架(zookeeper). MyThrift 敬请关注! 提出问题: 各种存储越来越多(redis,mysql,hdfs,hbase,mq), 让web开发人员自己访问存储,并保证性能,是一件高要求的事情。 造成的结果就是软件开发进度缓慢,性能低下,各种bug. 分析问题: RPC框架:考虑到本人将thrift的源码看过三四遍,尤其是针对网络模块非常熟悉,并在实际生产环境中使用过,thrift性能不错。 TCP/IP:有过2年的TCP/IP报文分析经验,从链路层到应用层都很熟悉。 ZooKeeper:在MySQL-Binlog项目中攒出了一些使用经验。 连接池:使用commons-pool连接池组件。 解决问题: 糅合thrift,zookeeper,commons-pool打造一款轻量级、性能高、上手容易的rpc调用框架, 使得架构师和后台开发人员可以将各种复杂存储的IO访问对外暴露为服务(其实就是跨机器的普通函数调用) 这样web开发人员可以专注于业务逻辑,加速产品迭代,对企业带来的好处不用多说! ---欢迎朋友们加入QQ群528941497

Thrift transport in javascript client

倖福魔咒の 提交于 2019-12-03 12:01:55
I'm trying to build a javascript client for my Thrift server. The server is up and running and I can get calls to the server working with a PHP client. I just can't figure out the javascript client. In particular, instantiating the transport baffles me. The tutorial at http://thrift.apache.org/tutorial/js/ shows: function calc() { var transport = new Thrift.Transport("/thrift/service/tutorial/"); var protocol = new Thrift.Protocol(transport); var client = new CalculatorClient(protocol); When I do this, I get an http 404 on "/var/www/thrift/service/tutorial/" I've found one or two other

libtool error building thrift 0.9.1 on Ubuntu 13.04

坚强是说给别人听的谎言 提交于 2019-12-03 10:18:17
Building thrift 0.9.1 (support C, C++, java, C#, perl, python) on Ubuntu 13.04 I am getting this error. ./configure run without any options, make run without any options... Making all in test make[2]: Entering directory `/home/dvb/sw/thrift-0.9.1/test' Making all in nodejs make[3]: Entering directory `/home/dvb/sw/thrift-0.9.1/test/nodejs' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/home/dvb/sw/thrift-0.9.1/test/nodejs' Making all in cpp make[3]: Entering directory `/home/dvb/sw/thrift-0.9.1/test/cpp' Makefile:832: warning: overriding commands for target `gen-cpp

Erlang Universal Binary Format? Anyone using it?

 ̄綄美尐妖づ 提交于 2019-12-03 09:45:24
问题 I recently stumbled upon this 2002 conference paper ( Getting Erlang to talk to the outside world by Joe Armstrong) and I was wondering whether this is a standard that was ignored or if there was any adoption? Should I focus on Apache Thrift for inter-platform communication? (whatever solution I choose will involve at least Erlang) 回答1: You might find the following information helpful about UBF (i.e. UBF User's Guide). http://ubf.github.com/ubf/ubf-user-guide.en.html This might help answer

Thrift - converting from simple JSON

狂风中的少年 提交于 2019-12-03 09:06:06
I created the following Thrift Object: struct Student{ 1: string id; 2: string firstName; 3: string lastName } Now I would like to read this object from JSON. According to this post this is possible So I wrote the following code: String json = "{\"id\":\"aaa\",\"firstName\":\"Danny\",\"lastName\":\"Lesnik\"}"; StudentThriftObject s = new StudentThriftObject(); byte[] jsonAsByte = json.getBytes("UTF-8"); TMemoryBuffer memBuffer = new TMemoryBuffer(jsonAsByte.length); memBuffer.write(jsonAsByte); TProtocol proto = new TJSONProtocol(memBuffer); s.read(proto); What I'm getting is the following

thrift: changing from tSimpleServer to TNonblockingServer

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a simple thrift server: shared_ptr<TProcessor> processor(new MyProcessor(handlerTrace)); shared_ptr<TServerTransport> serverTransport(new TServerSocket(port)); shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory()); shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory()); TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); and able to connect with the following lines: boost::shared_ptr<TSocket> socket(new TSocket("localhost", port)); boost::shared_ptr

How to set rpc timeout in thrift python client?

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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) transport = TTransport.TBufferedTransport(socket)

What's the best practice to for Thrift file (api) versioning?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 08:42:00
I have an API written in thrift. Example: service Api { void invoke() } It does something. I want to change the behavior to do something else but still keep the old behavior for clients that expect the old behavior. What's the best practice to handle a new API version? Soft versioning Thrift supports soft versioning, so it is perfectly valid to do a version 2 of your service which looks like this: service Api { void invoke(1: string optional_arg1, 2: i32 optional_arg2) throws (1: MyError e) i32 number_of_invokes() } Since the newly added arguments are technically optional, an arbitrary clients

Thrift IPC over pipes transport (Windows)

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been following Thrift support for Windows and VS development has come a long way thanks to a number of contributors. There are VS 2010 projects for the compiler and C++ library and I've confirmed that they work well in 0.8. http://thrift.apache.org/download/ My question is about implementing a transport layer in Thrift, specifically pipes (named or anonymous). I've been using TCP transport which works but in cases where the apps are all local, it's overkill and generally causes other complications such as with Windows Firewall. What I'd