finagle java_finagle_java_examples

git remote rm origin

已存在的文件夹或 Git 仓库

cd existing_folder

git init

git remote add origin git@gitee.com:walter80/finagle_java_examples.git

git add .

git commit

git push -u origin master

thrift --gen java -o src/main/ src/main/thrift/hello.thrift

Quick example of building a Thrift-based client and server in Java with Finagle.

The examples provided with Finagle itself are geared toward Scala, so this code covers some stumbling blocks I encountered while getting up and running.

This is just a quick program I run through IntelliJ to create a server and clients, which issue a series of blocking and non-blocking requests, all while being quite chatty about it, to demonstrate the basic flow of a Finagle server.

Notes:

The Finagle pom points to several internal Twitter locations. I've excluded those references that caused compilation to fail.

Finagle uses a custom thrift compiler that emits Finagle-specific classes. It can be downloaded from here: https://github.com/mariusaeriksen/thrift-0.5.0-finagle and is built and used in the usual way.

I'm moving the generated thrift code into java/main just to avoid hassles with maven finding it, not for a finagle reason

thrift:libthrift:pom:0.5.0 from Twitter doesn't have a pom associated with it, so Maven will complain about not being able to find one, but this doesn't prevent compilation or cause problems.

One needs to include the whole finagle package in maven. Just including finagle-thrift doesn't actually bring in the thrift package necessary for compilation

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值