1 Star 0 Fork 0

walter / finagle_java_examples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

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

空文件

简介

finagle java教程 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/walter80/finagle_java_examples.git
git@gitee.com:walter80/finagle_java_examples.git
walter80
finagle_java_examples
finagle_java_examples
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891