最佳答案
KeyedMessage<String, byte[]> keyedMessage = new KeyedMessage<String, byte[]>(request.getRequestTopicName(), SerializationUtils.serialize(message));
producer.send(keyedMessage);
Currently, I am sending messages without any key as part of keyed messages, will it still work with delete.retention.ms
? Do I need to send a key as part of the message? Is this good to make key as part of the message?