#!/bin/bash
-IMAGE=juplo/endless-producer:1.0-SNAPSHOT
+IMAGE=juplo/nullkey-producer:1.0-SNAPSHOT
if [ "$1" = "cleanup" ]
then
command: sleep infinity
producer:
- image: juplo/endless-producer:1.0-SNAPSHOT
+ image: juplo/nullkey-producer:1.0-SNAPSHOT
ports:
- 8000:8080
environment:
</parent>
<groupId>de.juplo.kafka</groupId>
- <artifactId>endless-producer</artifactId>
- <name>Endless Producer: a Simple Producer that endlessly writes numbers into a topic</name>
+ <artifactId>nullkey-producer</artifactId>
+ <name>Endless Producer: a Simple Producer that endlessly writes numbers into a topic without a key</name>
<version>1.0-SNAPSHOT</version>
<dependencies>
{
for (; running; i++)
{
- send(Long.toString(i%10), Long.toString(i));
+ send(Long.toString(i));
if (throttleMs > 0)
{
}
}
- void send(String key, String value)
+ void send(String value)
{
final long time = System.currentTimeMillis();
final ProducerRecord<String, String> record = new ProducerRecord<>(
topic, // Topic
- key, // Key
+ null, // Key
value // Value
);