I have been looking on the net for an example of how to use thrift with facebook-swift in java but couldn't find anything.
Hasn't anyone got an example to share?
I have been looking on the net for an example of how to use thrift with facebook-swift in java but couldn't find anything.
Hasn't anyone got an example to share?
I put a brief example in this question:
Can generate .thrift files from existing java/scala interfaces and data types?
Both the Thrift website and the Swift github repo have separate examples, and my example from that question can be used to glue them together.
Basically, on the Thrift side you generate code as per the Thrift documentation.
Same thing on the Swift side.
However, on the Swift side instead of using the built in 'Nifty' server (you could if you want to, but your question sounds like you are trying to interop with the Thrift libraries) you can create a ThriftServiceProcessor as per my example and then convert it using NiftyProcessorAdapter
to a normal TProcessor that can be passed into the standard Thrift Java library.
Hope that helps.
@BCG answer was good give me some starting points.
I have created an example of my findings and post it to GitHub.
if anybody needs it https://github.com/rojanu/thrift-swift-finagle-example
UPDATE I have updated the project at https://github.com/rojanu/thrift-swift-finagle-example Also, I have created forks of both facebook swift https://github.com/rojanu/swift and finagle https://github.com/rojanu/finagle. I have put local changes on to the forks and created pull requests for the both projects.