문제

Can I use Twitter Spring Integration as a gateway (or even splitter) instead of a polling consumer? The idea will be to use the payload as a query so I can do multiple twitter custom searches. That payload will come from another chain.

One way will be to use the http outbound gateway, but I will not go into this, because then I will have to implement the entire Twitter API (authentication - twitter template, tweet duplication - metadata store).

도움이 되었습니까?

해결책

The proper Spring Integration endpoint for that would be a <si-twitter:outbound-gateway/> for a request/response scenario; but we don't currently have that; feel free to open a new feature JIRA Issue for that.

However, under the covers, we use a TwitterTemplate; you can invoke it directly; something like...

TwitterTemplate tt = new TwitterTemplate(consumerKey, consumerSecret, accessToken,  accessTokenSecret);
SearchParameters searchParameters = new SearchParameters(query).count(20).sinceId(sinceId);
SearchResults results = tt.searchOperations().search(searchParameters);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top