Mikael Ståldal created KAFKA-4846: ------------------------------------- Summary: Use KafkaProducer without allocating a new ProducerRecord for each message sent Key: KAFKA-4846 URL: https://issues.apache.org/jira/browse/KAFKA-4846 Project: Kafka Issue Type: Improvement Components: producer Affects Versions: 0.10.2.0 Reporter: Mikael Ståldal
The KafkaProducer API requires you to allocate a new ProducerRecord for each record sent. This is unfortunate since some application wants to reduce object allocations to minimize GC work. This would be useful for Log4j to allow [garbage free logging|https://logging.apache.org/log4j/2.x/manual/garbagefree.html] in its [Kafka appender|https://logging.apache.org/log4j/2.x/manual/appenders.html#KafkaAppender]. This could be solved by adding a new method with unrolled arguments to KafkaProducer, like this: {code} Future<RecordMetadata> send(String topic, Integer partition, Long timestamp, K key, V value); {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)