Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TwitterClient startFilteredStream stop receiving tweet #439

Closed
akuma0 opened this issue Mar 20, 2023 · 4 comments
Closed

TwitterClient startFilteredStream stop receiving tweet #439

akuma0 opened this issue Mar 20, 2023 · 4 comments

Comments

@akuma0
Copy link

akuma0 commented Mar 20, 2023

Hi !
I don't understand why but after few minutes or few hours, onTweetStreamed stop received data, no error anywhere.
onStreamError, onUnknownDataStreamed or onStreamEnded didn't be call either...
Twitter monthly tweet cap usage at 3%

Any idea ?
(Running on v1.26)

Edit : 2023/03/22 :
It's looks relate to :

@akuma0
Copy link
Author

akuma0 commented Mar 22, 2023

UPDATE :
I've upgrade to v2.21 yesterday and today after 754 minutes of use i've got this error in onStreamEnded :

java.io.IOException: Premature EOF at java.base/sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:568) at java.base/sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:612) at java.base/sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:699) at java.base/java.io.FilterInputStream.read(FilterInputStream.java:133) at java.base/sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3510) at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181) at java.base/java.io.BufferedReader.fill(BufferedReader.java:161) at java.base/java.io.BufferedReader.readLine(BufferedReader.java:326) at java.base/java.io.BufferedReader.readLine(BufferedReader.java:392) at io.github.redouane59.twitter.helpers.TweetStreamConsumer.readSocket(TweetStreamConsumer.java:81) at io.github.redouane59.twitter.helpers.TweetStreamConsumer.lambda$consumeStream$0(TweetStreamConsumer.java:63) at java.base/java.lang.Thread.run(Thread.java:829)

@akuma0
Copy link
Author

akuma0 commented Mar 22, 2023

Stop receiving tweets after 151 minutes, no error this time...
I will try with a try/catch around the startFilteredStream.

@snicoll
Copy link
Contributor

snicoll commented Mar 23, 2023

this project does not have a capability of resuming the connection on error or when an operation disconnect happens. To fix this, you'd need to create your own thread monitoring the connection and resuming it when such things happen. Your issue is essentially a duplicate of #435

@akuma0
Copy link
Author

akuma0 commented Mar 28, 2023

Resolved by checked tweets reception every minute.

@akuma0 akuma0 closed this as completed Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants