props.put("bootstrap.servers", bootstrapServer);
props.put("client.id", clientId);
props.put("acks", acks);
+ props.put("metadata.max.age.ms", "1000");
props.put("key.serializer", StringSerializer.class.getName());
props.put("value.serializer", StringSerializer.class.getName());
final long time = System.currentTimeMillis();
final ProducerRecord<String, String> record = new ProducerRecord<>(
- "test", // Topic
+ topic, // Topic
key, // Key
value // Value
);