thrift

Use Apache Thrift NodeJS Client over HTTP

百般思念 提交于 2019-12-10 11:43:41
问题 Is there any clean way to connect a NodeJS Apache Thrift client to a Thrift Servlet over HTTP? I've tried implementing this by replacing the Connection with an http.ClientRequest object, then binding to the connect event on the underlying socket and re-emitting this from the client request object so that Thrift will send the queued bytes, but this ultimately results in parsing errors. Is there any clean way to use HTTP for a NodeJS Thrift client right now? 来源: https://stackoverflow.com

Using Thrift with Delphi Win32

非 Y 不嫁゛ 提交于 2019-12-10 09:58:47
问题 I'm interested in connecting to the Evernote Service API, which uses Thrift, from a Delphi Win32 app I am developing. I have done very little work with web services in Delphi, and nothing at all with Thrift. Where would be the best place to get up to speed w/using Thrift from Delphi? 回答1: Old Answer Replaced thanks to Leo: Thrift has generators for Delphi , C++, C#, Erlang, Haskell, Java, Objective C/Cocoa, OCaml, Perl, PHP, Python, Ruby, and Squeakr The generators for Thrift can be found in

Can Apache Thrift push notifications to clients?

我与影子孤独终老i 提交于 2019-12-10 03:41:55
问题 I'm looking to use Apache Thrift to have one client send data to the server and then have the server push that data to any clients. Is this possible, or would the client need to periodically check for new data? I'm looking for something similar to WCF's callbacks. I'm pretty new to Apache Thrift and I'm using it in C#/.NET currently and will likely have a Java client. Thanks. 回答1: I don't know whether the Thrift RPC mechanism is built to handle calls going both ways on a single socket

TTransportException when using TFramedTransport

人盡茶涼 提交于 2019-12-09 19:31:13
问题 I'm pretty puzzled with this issue. I have an Apache Thrift 0.9.0 client and server. The client code goes like this: this.transport = new TSocket(this.server, this.port); final TProtocol protocol = new TBinaryProtocol(this.transport); this.client = new ZKProtoService.Client(protocol); This works fine. However, if I try to wrap the transport in a TFramedTransport this.transport = new TSocket(this.server, this.port); final TProtocol protocol = new TBinaryProtocol(new TFramedTransport(this

thrift cpp sample code compile error

坚强是说给别人听的谎言 提交于 2019-12-09 18:08:29
问题 I'm new to Thrift. I think I installed it correctly. I have the folowing libs : luckyan315@ubuntu:~/code/thrift-0.8.0/tutorial/cpp$ ll /usr/local/lib/ total 11496 drwxr-xr-x 4 root root 4096 Mar 23 19:35 ./ drwxr-xr-x 10 root root 4096 Oct 12 22:27 ../ -rwxr-xr-x 1 root root 4100463 Mar 31 20:26 libthrift-0.8.0.so* -rw-r--r-- 1 root root 7256552 Mar 31 20:26 libthrift.a -rwxr-xr-x 1 root root 991 Mar 31 20:26 libthrift.la* lrwxrwxrwx 1 root root 18 Mar 23 19:35 libthrift.so -> libthrift-0.8.0

Any success using Apache Thrift on iPhone?

只愿长相守 提交于 2019-12-09 17:19:30
问题 Has anybody done or seen a deployment of Apache Thrift in an iPhone app? I am wondering if is a reasonable solution for a high-volume, low(er)-latency network service for iPhones compared to HTTP. One noteworthy thing I found is a bug report about running Thrift on the iPhone, which seems to have been fixed. But that doesn't necessarily indicate that it's a done deal. 回答1: Thrift and HTTP aren't mutually exclusive. In fact thrift now ships with an HTTP transport implementation to use. It's

Enable Thrift in Cassandra Docker

不羁的心 提交于 2019-12-09 14:45:53
问题 I'm trying to start up a docker image that runs cassandra. I need to use thrift to communicate with cassandra, but it looks like that's disabled by default. Checking out the cassandra logs shows: INFO 21:10:35 Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it My question is: how can I enable thrift when starting this cassandra container? I've tried to set various environment variables to no avail: docker run --name cs1 -d

序列化和反序列化-刘丁

为君一笑 提交于 2019-12-09 13:08:08
#一、定义以及相关概念 互联网的产生带来了机器间通讯的需求,而互联通讯的双方需要采用约定的 协议 ,序列化和反序列化属于通讯 协议 的一部分。通讯 协议 往往采用分层模型,不同模型每层的功能定义以及颗粒度不同,例如:TCP/IP 协议 是一个四层 协议 ,而OSI模型却是七层 协议 模型。 在 OSI七层 协议 模型中 展现层 (Presentation Layer) 的主要功能是把 应用层 的 对象 转换成一段连续的 二进制串 ,或者反过来,把 二进制串 转换成 应用层 的 对象 --这两个功能就是序列化和反序列化。 一般而言, TCP/IP 协议 的 应用层 对应与 OSI七层 协议 模型的 应用层 ,展示层和会话层 ,所以序列化 协议 属于 TCP/IP 协议 应用层 的一部分。 本文对序列化 协议 的讲解主要基于 OSI七层 协议 模型 。 序列化: 将 数据结构 或 对象 转换成 二进制串 的过程 反序列化:将在序列化过程中所生成的 二进制串 转换成 数据结构 或者 对象 的过程 数据结构 、 对象 与 二进制串 不同的计算机语言中, 数据结构 , 对象 以及 二进制串 的表示方式并不相同。 数据结构 和 对象 :对于类似Java这种完全面向 对象 的语言,工程师所操作的一切都是 对象 (Object),来自于类的实例化。在Java语言中最接近 数据结构 的概念

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

若如初见. 提交于 2019-12-09 07:12:30
问题 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? 回答1: 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

C++ linker error after change in thrift file

故事扮演 提交于 2019-12-09 07:07:26
I think this is related to C++ linker error than to thrift. I made a change to the thrift file and regenerated cpp & java classes. After this change, I started getting linker errors in cpp. Here is the error Undefined symbols: "com::XXXX::thrift::employee::SavingsInfo::operator<(com::XXXX::thrift::employee::SavingsInfo const&) const", referenced from: std::less::operator()(com::XXXX::thrift::employee::SavingsInfo const&, com::XXXX::thrift::employee::SavingsInfo const&) constin employee_types.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [ThriftCPPSamples] Error 1 I