Package kafka
Class Kafka
- java.lang.Object
-
- kafka.Kafka
-
public class Kafka extends java.lang.ObjectClass to connect to Apache Kafka server.
-
-
Constructor Summary
Constructors Constructor Description Kafka()
-
Method Summary
Modifier and Type Method Description static voidconnectStream(java.lang.String bearerToken)This method calls the filtered stream endpoint and streams Tweets from it.static voidsetupRules(java.lang.String bearerToken, java.util.Map<java.lang.String,java.lang.String> rules)Helper method to setup rules before streaming data.
-
-
-
Method Detail
-
connectStream
public static void connectStream(java.lang.String bearerToken) throws java.net.URISyntaxException, java.io.IOExceptionThis method calls the filtered stream endpoint and streams Tweets from it.- Parameters:
bearerToken- Authorization token to connect to Twitter API.- Throws:
java.net.URISyntaxException-during the http request.java.io.IOException-trying to get the content from the stream or to read the line.
-
setupRules
public static void setupRules(java.lang.String bearerToken, java.util.Map<java.lang.String,java.lang.String> rules) throws java.io.IOException, java.net.URISyntaxExceptionHelper method to setup rules before streaming data.- Parameters:
bearerToken- Authorization token to connect to Twitter API.rules- Rules for streaming data.- Throws:
java.net.URISyntaxException-during the http request.java.io.IOException-trying to get the content from the request.
-
-