Apache Kafka stores the message with offset. The following are several ways the messages can be retrieved with time;
Message Creation
When the message is created append the runtime to the message in the producer class before publishing the message to the topic as follows:
String runtime = new Date.toString();
String msg = "Test Message " + runtime;
KeyedMessage<String,String> data = new KeyedMessage<String, String> (topic,msg);
producer.send(data);
The message can be retrieved using the runtime stamp
Apache Kafka System Tools
Apache Kafka provided system tools to get messages
0 Comments