Twitter open sources Java streaming library Hosebird
Twitter has open sourced a Java library for its Streaming API. The Hosebird Client (hbc) supports OAuth and automatic reconnections with appropriate wait periods and Twitter says it has been "battle-tested in production" by its internal teams.
The library is in two parts: hbc-core and hbc-twitter4j. The hbc-core module pulls the actual messages from the API and implements a message queue that consumer applications can poll for tweets. The second module lets users plug the Twitter4J data model into the core library to parse tweets and display them in end-user applications.
Hosebird is able to use gzip compression and can access raw bytes payloads as well. Twitter also says that it provides "relevant statistics". The GitHub page for Hosebird includes instructions how to get started with the library. After setting up the connection information and creating a client to receive the messages with ClientBuilder, developers can receive a sample stream by compiling their example code with Maven and passing their access credentials and token to it. The README file on GitHub then goes into more detail on how to handle OAuth authentication correctly and how to work with and filter the firehose stream. Example code is also provided.
The Hosebird Client is released under the Apache 2.0 License and was authored by Steven Liu and Kevin Oliver.