Closed oleg-grigorijan closed 2 years ago
Hey @oleg-grigorijan , hmmm good point, I never saw it before. That's strange because I'm running a bot streaming some keywords 24/7. Can you give me the exact method you're using ? In all cases, I think that the method actually takes the message as it is and parse it, so if the Json is not valide, it will give an exception. I should try to see how to change its behaviour.
@redouane59
I use TwitterClient#startFilteredStream(IAPIEventListener)
(with configured filtering rules by TwitterClient#addFilteredStreamRule(String, String)
).
In all cases, I think that the method actually takes the message as it is and parse it, so if the Json is not valide, it will give an exception. I should try to see how to change its behaviour.
Yes, a badly formatted message may be an issue on the Twitter side. But maybe the stream connection should not be closed after a single separate message processing exception. For this case IAPIEventListener#onUnknownDataStreamed(String)
can be invoked instead.
Yes, a badly formatted message may be an issue on the Twitter side. But maybe the stream connection should not be closed after a single separate message processing exception. For this case
IAPIEventListener#onUnknownDataStreamed(String)
can be invoked instead.
Yes of course, going to check that.
I think that https://github.com/redouane59/twittered/pull/348/files should solve the issue
Could you build the library on the develop branch and told me if it solves the problem ?
Yes it does. Thanks a lot
Great, the fix will be included on the next release :)
Sometimes only a chunk of a tweet JSON object is received during tweets streaming. It is unexpected by the library and causes JsonParseException and connection closing. This problem occurs very often.
Real example:
Previous streamed message (valid finished JSON):
Next streamed message:
Causes: