0

I'm using Twitter4j to get Tweets real time via. Twitter streaming API and it is working fine . Sometime it throws Exception due to network connecting issue(or some other reason) which is also OK to me however I'm not able to recover from this condition & it require server restart . Can someone please suggest how to restart listening Twitter straming Api Again without server restart . We have TwitterStreamFactory & TwitterStream class in Twitter4j. Many thanks in advance .

Raj
  • 1,698
  • 4
  • 22
  • 39

1 Answers1

1

You should create a handler for such exceptions and in it create a loop that tries to start listening a few times before erroring out.

Dane Hillard
  • 890
  • 1
  • 11
  • 27