I'm currently working on setting up an tomcat8-server and want to write an servlet on it, which handles POST-requests with sensorvalues attached to it.
I want this sensordata to be emitted to Apache Kafka through a producer, setted up in the servlet. I wanted to set up a test-http-servlet with the code from "How to send a message via Kafka.Producer from a java servlet to Kafka" to learn writing my own.
But on compiling with:javac -cp /home/tobias/apache-tomcat-8.5.8/lib/servlet-api.jar HTTPServlet.java
, I get the following message:
HTTPServlet.java:19: error: package kafka.producer does not exist
import kafka.producer.ProducerConfig;
^
HTTPServlet.java:20: error: package kafka.javaapi.producer does not exist
import kafka.javaapi.producer.ProducerData;
^
I did already put the "kafka_2.11-0.10.1.0.jar", which contains the "kafka.producer.ProducerConfig"-class into the "WEB-INF/lib" folder, but It does not seem to work.
This "kafka_2.11-0.10.1.0.jar" was located in the "libs" folder of "kafka_2.11-0.10.1.0", which can be downloaded from the kafka-website.
So I wanted to ask, how I would get this working and If anyone knows, where the 2. missing file is located in the latest release of kafka.