public void testProduce() throws Exception {
        Properties producerProps = new Properties();
        producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, testConfig.bootstrapServer);
        if (!testConfig.idempotentProducerSupported) {
            producerProps.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, "false");
        }
        ByteArraySerializer serializer = new ByteArraySerializer();
        KafkaProducer<byte[], byte[]> producer = new KafkaProducer<>(producerProps, serializer, serializer);
        ProducerRecord<byte[], byte[]> record1 = new ProducerRecord<>(testConfig.topic, message1);
        Future<RecordMetadata> future1 = producer.send(record1);
        ProducerRecord<byte[], byte[]> record2 = new ProducerRecord<>(testConfig.topic, message2);
        Future<RecordMetadata> future2 = producer.send(record2);
        producer.flush();
        future1.get();
        future2.get();
        producer.close();
    }
ClientCompatibilityTest is invoked by the ducktape test client_compatibility_features_test.py to validate
client behavior when various broker versions are in use.  It runs various client operations and tests whether they
are supported or not.
tools/src/main/java/org/apache/kafka/tools/ClientCompatibilityTest.java