Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Apache Storm

You're reading from  Mastering Apache Storm

Product type Book
Published in Aug 2017
Publisher
ISBN-13 9781787125636
Pages 284 pages
Edition 1st Edition
Languages
Author (1):
Ankit Jain Ankit Jain
Profile icon Ankit Jain

Table of Contents (19) Chapters

Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
1. Real-Time Processing and Storm Introduction 2. Storm Deployment, Topology Development, and Topology Options 3. Storm Parallelism and Data Partitioning 4. Trident Introduction 5. Trident Topology and Uses 6. Storm Scheduler 7. Monitoring of Storm Cluster 8. Integration of Storm and Kafka 9. Storm and Hadoop Integration 10. Storm Integration with Redis, Elasticsearch, and HBase 11. Apache Log Processing with Storm 12. Twitter Tweet Collection and Machine Learning

Twitter sentiment analysis


We will be dividing the sentiments use case into two parts:

  • Collecting tweets from Twitter and storing them in Kafka
  • Reading the data from Kafka, calculating the sentiments, and storing them in HDFS

Using Kafka producer to store the tweets in a Kafka cluster

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:

  1. Create a new maven project with groupId, com.stormadvance and artifactId, kafka_producer_twitter.

 

  1. Add the following dependencies to the pom.xml file. We are adding the Kafka and...
lock icon The rest of the chapter is locked
arrow left Previous Chapter
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}