private Producer createProducer(Topic topic, ProducersConfig config, ProducerCallback callback) {
        Properties properties = new Properties();
        properties.putAll(config.properties);
        properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, config.bootstrapServer);
        properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
        properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName());
        properties.put(ProducerConfig.PARTITIONER_IGNORE_KEYS_CONFIG, true);

        KafkaProducer<String, byte[]> kafkaProducer = new KafkaProducer<>(properties);
        return new Producer(kafkaProducer, topic, callback);
    }
Create producers for the given topics.
NOT thread-safe.

@param topics   topic names
@param config   producer configuration
@param callback callback to be called when a message is sent
@return number of producers created
tools/src/main/java/org/apache/kafka/tools/automq/perf/ProducerService.java