I am trying to get tweets from my Twitter timeline with ConsumerTemplate
(Camel) in a Quarkus app.
I don't understand how it should be done correctly while using rate limits (my free account has rate 15 polls in 5 min).
The Camel setup has property count which I set to 10
, and expect to get 10
new tweets in one poll, but the problem is that template offers only one tweet per Camel request:
for (int i = 0; i < 15; i++) {
// I would expect here List or stream, but I can get only single `Status`
final Status tweets = consumerTemplate.receiveBodyNoWait(String.format("twitter-timeline://home?sinceId=%s&count=10", sinceId), Status.class);
// just to show that I change that property
if (nonNull(tweets)) {
sinceId = tweets.getId();
}
}
So my question is why I get only one tweet per poll even if count is set (a value more than 1
). Is there any better way or running that template, or something I can use instead while respecting downstream Twitter rate limits?