You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Márcio Faria <fa...@ymail.com> on 2017/03/03 04:40:27 UTC

Processor using Apache Thrift ?

Hi Andy,

Apologies both for this delayed response and the missing subject of the original message.

Thank you for your suggestions. 

Option # 1, I'm afraid, is not applicable. You see, working with Apache Thrift [1], similarly to Protocol Buffers [2], involves writing specifications of data types and service interfaces in a platform-independent "definition language", then "compiling" them into, e.g., Java, Python, or C++ code. The final result is a client program or library that can read/write only messages complying with those specific definitions. There is no generic client.
Option # 2 would be my first choice then, but Chris Herrera, who also replied to this thread, recommended Option #3, and for good reasons.
I know that binary protocols in general offer better serialization performance, but there are many valid use cases where employing more verbose formats like JSON or even XML (argh!) is fine, or at least good enough. I just wish that working with Thrift in NiFi was as easy as working with Avro. 
[1] http://thrift.apache.org/
[2] https://developers.google.com/protocol-buffers/


Thank you,
Marcio

On Tuesday, February 14, 2017 10:31 PM, Andy LoPresto <al...@apache.org> wrote:



Hello Márcio,

I have not used Thrift, but in reading the introduction from the link you provided, my first reactions would be as follows:

1. To communicate with a service defined by Thrift, I’d look at InvokeHTTP and see if it covers your needs. 
2. If not, I would try downloading the Thrift client and invoking it via Groovy in an ExecuteScript processor.
3. If that is not sufficient, you would have to build a custom processor and include Thrift as a dependency. 

Someone else may have more experience, but I would try in that order (from easiest to hardest). Good luck. 


Andy LoPresto
alopresto@apache.org
alopresto.apache@gmail.com
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

On Feb 14, 2017, at 6:24 PM, Márcio Faria <fa...@ymail.com> wrote:
>
>Dear NiFi users,
>
>Does anybody have an example of a NiFi component talking to a Apache Thrift (https://thrift.apache.org/) -based webservice?
>
>Thank you,
>
>Marcio
>

Re: Processor using Apache Thrift ?

Posted by Márcio Faria <fa...@ymail.com>.
Hi Chris,
Thank you for sharing your experience using Thrift with NiFi, and please accept my apologies for this delayed response. 
Writing a new processor is also what I'm now considering to do. The Maven archetype will be a good start.
Thanks again,
Marcio

On Tuesday, February 14, 2017 10:41 PM, Chris Herrera <ch...@gmail.com> wrote:

Try that again sending from the right address this time :).

On Feb 14, 2017, at 9:40 PM, Chris Herrera <ch...@hashmapinc.com> wrote:
>
Hi Marcio,

I played around with this a bit and eventually needed to build a custom processor that essentially used thrift as a dependancy. Originally I tried it through ExecuteScript but it took me more time than just writing a new processor. 
There is a really good example of doing this here: https://cwiki.apache.org/confluence/display/NIFI/Maven+Projects+for+Extensions#MavenProjectsforExtensions-MavenProcessorArchetype using the maven archtype. 

Regards,
Chris

On Feb 14, 2017, at 8:24 PM, Márcio Faria <fa...@ymail.com> wrote:
>
>Dear NiFi users,
>
>Does anybody have an example of a NiFi component talking to a Apache Thrift (https://thrift.apache.org/) -based webservice?
>
>Thank you,
>
>Marcio