In this section, we are going to cover how we can stream the tweets from Twitter using the twitter streaming API. We are also going to cover how we can store the fetched tweets in Kafka for later processing through Storm.
We are assuming you already have a twitter account, and that the consumer key and access token are generated for your application. You can refer to: https://bdthemes.com/support/knowledge-base/generate-api-key-consumer-token-access-key-twitter-oauth/ to generate a consumer key and access token. Take the following steps:
- Create a new maven project with groupId, com.stormadvance and artifactId, kafka_producer_twitter.
- Add the following dependencies to the pom.xml ...