Я использую конечную точку Twitter-шкалы времени от Apache Camel. Когда я достигаю ограничения скорости, я получаю исключение, и мне нужно с ним справиться.
Как я могу обработать исключение?
Есть ли возможность удерживать маршрут и ждать? Или есть более простой способ получить график от нескольких пользователей?
[ #17 - twitter-timeline://user] DefaultTwitterConsumer WARN Consumer Consumer[twitter-timeline://user?accessToken=...&accessTokenSecret=...&consumerKey=...&consumerSecret=...&count=200&delay=10&filterOld=false&numberOfPages=16&sendEmptyMessageWhenIdle=true&user=katyperry] failed polling endpoint: twitter-timeline://user?accessToken=...&accessTokenSecret=...&consumerKey=...&consumerSecret=...&count=200&delay=10&filterOld=false&numberOfPages=16&sendEmptyMessageWhenIdle=true&user=katyperry. Will try again at next poll. Caused by: [twitter4j.TwitterException - 429:Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for the resource. See Rate Limiting in API v1.1.(https://dev.twitter.com/docs/rate-limiting/1.1)
message - Rate limit exceeded
code - 88
]
twitter4j.TwitterException: 429:Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for the resource. See Rate Limiting in API v1.1.(https://dev.twitter.com/docs/rate-limiting/1.1)
message - Rate limit exceeded
code - 88
at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:164) ~[twitter4j-core-4.0.6.jar:4.0.6]
at twitter4j.HttpClientBase.request(HttpClientBase.java:57) ~[twitter4j-core-4.0.6.jar:4.0.6]
at twitter4j.HttpClientBase.get(HttpClientBase.java:75) ~[twitter4j-core-4.0.6.jar:4.0.6]
at twitter4j.TwitterImpl.get(TwitterImpl.java:1786) ~[twitter4j-core-4.0.6.jar:4.0.6]
at twitter4j.TwitterImpl.getUserTimeline(TwitterImpl.java:144) ~[twitter4j-core-4.0.6.jar:4.0.6]
at org.apache.camel.component.twitter.timeline.UserConsumerHandler.doPoll(UserConsumerHandler.java:42) ~[camel-twitter-2.22.2.jar:2.22.2]
at org.apache.camel.component.twitter.timeline.AbstractStatusConsumerHandler.pollConsume(AbstractStatusConsumerHandler.java:39) ~[camel-twitter-2.22.2.jar:2.22.2]
at org.apache.camel.component.twitter.timeline.UserConsumerHandler.pollConsume(UserConsumerHandler.java:29) ~[camel-twitter-2.22.2.jar:2.22.2]
at org.apache.camel.component.twitter.consumer.DefaultTwitterConsumer.poll(DefaultTwitterConsumer.java:94) ~[camel-twitter-2.22.2.jar:2.22.2]
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174) [camel-core-2.22.2.jar:2.22.2]
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101) [camel-core-2.22.2.jar:2.22.2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_191]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_191]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_191]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_191]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Спасибо за вашу помощь! :)