/** * * @param kafkaHost the host * @param kafkaTopic the topic name on which to publish the tweets * @param kafkaPort the port for Kafka clients to connect */ public TweetIngestor(String kafkaHost,String kafkaTopic, int kafkaPort, String track, double tweetRate) { TwitterStreamFactory fact = new TwitterStreamFactory(); checkState(fact.getInstance().getConfiguration().isJSONStoreEnabled(), "Twitter4j JSON store is disabled. You must enabled it in the twitter4j.properties file!"); stream = fact.getInstance(); poster = new RemoteKafkaPoster(METRIC_REGISTRY, kafkaHost, kafkaPort); this.kafkaTopic = kafkaTopic; this.rateLimiter = RateLimiter.create(tweetRate); this.track = track; }