title: Can any random Java Server act as a producer in Apache Kafka?
body: <p>I have a Java Server on localhost:2001, where a frequently updated JSON file is stored. In an attempt to save the changing values of the JSON historically, I want to set up Apache Kafka and am using their event listener capabilities.</p>
  <p>Is this even the right approach to take here, because all I want is a table of the changed values of the JSON over time and it seems like a bit of an overkill to work with Kafka?</p>
  <p>Anyways, my actual question while setting up the infrastructure was, if <em><strong>any</strong></em> server can be used as a producer like that:</p>
  <pre><code>    Properties props = new Properties();
      props.put(&quot;bootstrap.servers&quot;, &quot;localhost:2001&quot;);
      props.put(&quot;key.serializer&quot;, &quot;org.apache.kafka.common.serialization.StringSerializer&quot;);
      props.put(&quot;value.serializer&quot;, &quot;org.apache.kafka.common.serialization.StringSerializer&quot;);
      
      Producer&lt;String, String&gt; producer = new KafkaProducer&lt;String, String&gt;(props);
      
      ProducerRecord&lt;String, String&gt; record = new ProducerRecord&lt;String, String&gt;(&quot;test&quot;, &quot;hello world&quot;);
      
      producer.send(record);
      
      producer.close();
  </code></pre>
  <p>Given localhost:2001 is a Java Server with some JSON. I could also get the JSON from the server with a get request <code>Submodel.getSubmodelElements()</code></p>
  <pre><code>ProducerRecord&lt;String, String&gt; record = new ProducerRecord&lt;Object&gt;(Submodel.getSubmodelElements());
  </code></pre>
  <p>Is this the correct architectural approach to saving timeseries data in a database or am I on a wrong path? Any pointers are appreciated!</p>