GithubHelp home page GithubHelp logo

veesonsan / thrift-zookeeper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eirslett/thrift-zookeeper

0.0 2.0 0.0 138 KB

How to use Thrift with Zookeeper - using Finagle and Java

Thrift 2.12% Java 97.88%

thrift-zookeeper's Introduction

=== Thrift-Zookeeper example ===
This example used Finagle, a library developed at Twitter.
It contains:
- api: A Thrift API that defines a FooService
- commons-thrift: Common logic used for service discovery
- server: A Thrift server providing the FooService
- client: A consumer of the service

To run:
- mvn clean install
- Run a local ZooKeeper instance
- Start as many instances of MyAppThriftServer as you want
- Run the client (MyAppThriftClient)

Example output:
Online servers: [/0:0:0:0:0:0:0:0:3705, /0:0:0:0:0:0:0:0:5071, /0:0:0:0:0:0:0:0:2381]

Got hey, this is a response from port=3705
Got hey, this is a response from port=3705
Got hey, this is a response from port=5071
Got hey, this is a response from port=5071
Got hey, this is a response from port=2381
Got hey, this is a response from port=3705
...

Monitoring
- Start a server instance
- Check out http://localhost:XXXX/stats.txt (XXXX is the port number for Ostrich admin)

What are the good parts?
- Service discovery
- Finagle handles load balancing, so it connects to one of the servers ZooKeeper has registered.
- It also handles connection pooling, retries, timeouts, statistics, backpressure
- It can be used to create Scala-native Thrift clients/servers
- It's written to be asynchronous
- No thrift binary required for building
- Throw in 10 lines of code and there's monitoring, with Ostrich:
https://github.com/twitter/ostrich
- Throw in 10 lines of code and there's distributed tracing, with Zipkin:
- https://github.com/twitter/zipkin

thrift-zookeeper's People

Contributors

eirslett avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.