Streaming API with Jetty Http Client(Java)


I’m using Jetty Http Client(Java) to interact with Twitter streaming API( I always get “early EOF” excetption: early EOF
at org.eclipse.jetty.client.AbstractHttpConnection$Handler.earlyEOF(
at org.eclipse.jetty.http.HttpParser.parseNext(
at org.eclipse.jetty.http.HttpParser.parseAvailable(
at org.eclipse.jetty.client.AsyncHttpConnection.handle(
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
at org.eclipse.jetty.util.thread.QueuedThreadPool$

I saw Twitter recommends to use Apache Http Client to implement the streaming.

Some HTTP client libraries only return the response body after the connection has been closed by the server. These clients will not work for accessing the Streaming API. You must use an HTTP client that will return response data incrementally. Most robust HTTP client libraries will provide this functionality. The Apache HttpClient will handle this use case, for example.

So is there anyone using Jetty client to implement the streaming? I don’t think there should be a problem with Jetty client because Jetty can read the data incrementally…