Questions tagged [thrift-protocol]

The protocol family used by the cross-platform, crosss-language Apache Thrift RPC and serialization framework

Thrift combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, C, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk, Delphi, Graphviz, Go and OCaml.

Thrift's primary goal is to enable efficient and reliable communication across platforms and programming languages by abstracting the portions of each language that tend to require the most customization into a common library that is implemented in each language.

Originally developed at Facebook, Thrift was open sourced in April 2007 and entered the Apache Incubator in May, 2008. Thrift graduated from the Incubator in October, 2010.

169 questions
5
votes
0 answers

Clarify purpose of fields in Thrift TSSLSocket

I'm trying to understand the semantics of the SSL Sockets in Thrift. In particular what the fields: ca_certs, keyfile,and certfile accomplish. Is the usage that on a client the keyfile is a path to a private key and then this is verified using a…
bearrito
  • 2,217
  • 1
  • 25
  • 36
5
votes
0 answers

Creating binary (custom length) string in C++

I am using Apache Thrift RPC (Compiled to C++) mechanism to communicate with Apache Flume. I have to use specific API that this platform supplies. I want to send binary data, But the RPC function accepts only std::string as a parameter. And because…
Rtik88
  • 1,777
  • 2
  • 11
  • 13
5
votes
3 answers

Can generate .thrift files from existing java/scala interfaces and data types?

Is there an easy way to take existing Java/scala datatypes and API interfaces and produce corresponding .thrift files? Having Thrift generate server data structures is excessively invasive as it has the consequences: I cannot annotate my data…
user48956
  • 14,850
  • 19
  • 93
  • 154
5
votes
1 answer

Trying to get a Python client talk to a Java Server using thrift's TFileTransport and TFileProcessor

I am trying to wrap a Java class to be called from Python using thrift's TFileTransport. I tried using two protocols TJSON and TBinary but I keep getting this exception org.apache.thrift.transport.TTransportException: FileTransport error: bad event…
4
votes
1 answer

Reference to Thrift not found when running nodejs Thrift example

I am trying to run the nodejs server/client thrift example but I cannot get it to run. Initially, I added thrift as a dependency in my package.json file. Then I did an npm install which installed thrift. Then I attempted to run the server using node…
chromozonex
  • 211
  • 2
  • 15
4
votes
2 answers

'TProtocol' does not contain a definition for 'IncrementRecursionDepth'

I've installed thrift for both my library and server; using NuGet. I have a very simple thrift file that I've compiled it using the following command: thrift.exe -r --gen csharp node.thrift the node.thrift has three lines: service Server { …
aliep
  • 1,702
  • 2
  • 21
  • 33
4
votes
1 answer

Thrift python 3.4 TypeError: string argument expected, got 'bytes'

I am trying out Apache Thrift using python 3.4 which Thrift seems to have support, since it has lib.linux-x86_64-3.4 under build directory. But I am keeping getting this error message File…
Allanqunzi
  • 3,230
  • 1
  • 26
  • 58
4
votes
1 answer

How do exception messages in Thrift exceptions work?

I thrift IDL files you can define your own exception types that a service method may throw: exception SampleException { 1: list failed } Whats the contract for seeing a proper exception message in the logs? I have seen log messages…
reikje
  • 2,850
  • 2
  • 24
  • 44
4
votes
1 answer

Thrift large file in messages

I am using thrift for binary protocol over tcp, for sending and reading files (maximum size of 64MB). Is thrift is capable for this? I have thought using: struct SomeMessage { 1: byte data } How thrift is efficient about this?…
Yosi
  • 2,936
  • 7
  • 39
  • 64
4
votes
2 answers

Thrift RPC headers

Does Thrift have a mechanism for passing tokens (e.g. auth token strings) when making a remote call? The only option I can see is to include the auth token string in the method signature?
Myles McDonnell
  • 12,943
  • 17
  • 66
  • 116
4
votes
2 answers

Use your own communication protocol with apache thrift?

I was wondering if it's possible to just use the serialization portions of apache thrift. I basically have a custom communication protocol already created, and would like to pass a thrift object from my server (PHP) to the client (C#). My home-grown…
Geesu
  • 5,928
  • 11
  • 43
  • 72
3
votes
0 answers

Non-Blocking Thrift Server in C++ and Thrift Client in Python

I have a non-blocking multi-threaded thrift server written in C++ and a thrift client written in python. Below code snippets briefly shows how the thrift protocol and binding configurations are done in both C++ server and python client. My problem…
F. Aydemir
  • 2,665
  • 5
  • 40
  • 60
3
votes
1 answer

Is safe to rename a field in Thrift IDL?

Is it safe to deprecate a field in Thrift by renaming if the field is no longer used by clients? My understanding is this should work as long as we don't change the type. For example From struct FooResponse { 1: optional i32 foo } To struct…
hackjutsu
  • 8,336
  • 13
  • 47
  • 87
3
votes
0 answers

PHP 7 post_max_size ini setting work for limiting raw POST data?

I am using Apache Thrift to move small base64 encoded files to a PHP backend (with Apache web server). It is essentially just an HTTP POST request with large amounts of raw body data. I want to limit how much data can be POSTed so that I don't even…
Luke Cordingley
  • 665
  • 4
  • 11
3
votes
1 answer

python thrift union type can not be serialized?

I define a union type in topic.thrift file, and generate gen-py. like this: union Generic{ 1: string s, 2: bool b, 3: i64 i, 4: double d} struct Article{ 1: string title, 2: string content, 3: Generic test} and the serialize code like…
Nan
  • 31
  • 2
1
2
3
11 12