如何设置kafka事务生成器

时间:2017-11-19 08:55:47

标签: apache-kafka kafka-producer-api spring-kafka

我试图在Windows 10上设置kafka事务生成器。我从CLI下载并运行kafka作为单个节点。运行如下:

  • 。\ bin \ windows \ zookeeper-server-start.bat。\ config \ zookeeper.properties
  • 。\ bin \ windows \ kafka-server-start.bat。\ config \ server.properties

(仅更改了server.properties - > log.dirs)

一切都很好,卡夫卡正在运转。 默认测试:kafka-console-producer,kafka-console-consumer运行良好。

public class SampleTest {

    private final static Logger logger = LoggerFactory.getLogger(SampleTest.class);

    public static void main(String[] args) {

        Properties producerConfig = new Properties();
        producerConfig.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
        producerConfig.put(ProducerConfig.CLIENT_ID_CONFIG, "transactional-producer");
        producerConfig.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, true); // enable idempotence
        producerConfig.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, "test-trx-id123"); // set transaction id
        producerConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
        producerConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);

        Producer<String, String> producer = new KafkaProducer<>(producerConfig);

        producer.initTransactions();
        try {
            producer.beginTransaction();
            String firstMsg = "Hello 1";
            producer.send(new ProducerRecord<>("test", firstMsg, firstMsg));
            producer.commitTransaction(); //commit
        } catch (KafkaException e) {
            producer.abortTransaction();
        }

        // SECOND MESSAGE NEVER SENT !!!
        logger.info("================================ FIRST TRX ENDED ======================================");

        try {
            producer.beginTransaction();
            String secondMessage = "Hello 2";
            producer.send(new ProducerRecord<>("test", secondMessage, secondMessage));
            producer.commitTransaction(); //commit
        } catch (KafkaException e) {
            producer.abortTransaction();
        }

        producer.close();
    }

}

尝试设置事务生成器。上面的示例向主题&#34; test&#34;发送2条消息。第一个消息已成功发送,但第二个消息从未发送过。

调试日志:

[2017-11-19 10:33:09,239] INFO ProducerConfig values: 
    acks = 1
    batch.size = 16384
    bootstrap.servers = [localhost:9092]
    buffer.memory = 33554432
    client.id = transactional-producer
    compression.type = none
    connections.max.idle.ms = 540000
    enable.idempotence = true
    interceptor.classes = null
    key.serializer = class org.apache.kafka.common.serialization.StringSerializer
    linger.ms = 0
    max.block.ms = 60000
    max.in.flight.requests.per.connection = 5
    max.request.size = 1048576
    metadata.max.age.ms = 300000
    metric.reporters = []
    metrics.num.samples = 2
    metrics.recording.level = INFO
    metrics.sample.window.ms = 30000
    partitioner.class = class org.apache.kafka.clients.producer.internals.DefaultPartitioner
    receive.buffer.bytes = 32768
    reconnect.backoff.max.ms = 1000
    reconnect.backoff.ms = 50
    request.timeout.ms = 30000
    retries = 0
    retry.backoff.ms = 100
    sasl.jaas.config = null
    sasl.kerberos.kinit.cmd = /usr/bin/kinit
    sasl.kerberos.min.time.before.relogin = 60000
    sasl.kerberos.service.name = null
    sasl.kerberos.ticket.renew.jitter = 0.05
    sasl.kerberos.ticket.renew.window.factor = 0.8
    sasl.mechanism = GSSAPI
    security.protocol = PLAINTEXT
    send.buffer.bytes = 131072
    ssl.cipher.suites = null
    ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
    ssl.endpoint.identification.algorithm = null
    ssl.key.password = null
    ssl.keymanager.algorithm = SunX509
    ssl.keystore.location = null
    ssl.keystore.password = null
    ssl.keystore.type = JKS
    ssl.protocol = TLS
    ssl.provider = null
    ssl.secure.random.implementation = null
    ssl.trustmanager.algorithm = PKIX
    ssl.truststore.location = null
    ssl.truststore.password = null
    ssl.truststore.type = JKS
    transaction.timeout.ms = 60000
    transactional.id = test-trx-id123
    value.serializer = class org.apache.kafka.common.serialization.StringSerializer
 (org.apache.kafka.clients.producer.ProducerConfig)
[2017-11-19 10:33:09,301] INFO Instantiated a transactional producer. (org.apache.kafka.clients.producer.KafkaProducer)
[2017-11-19 10:33:09,303] INFO Overriding the default retries config to the recommended value of 2147483647 since the idempotent producer is enabled. (org.apache.kafka.clients.producer.KafkaProducer)
[2017-11-19 10:33:09,303] INFO Overriding the default max.in.flight.requests.per.connection to 1 since idempontence is enabled. (org.apache.kafka.clients.producer.KafkaProducer)
[2017-11-19 10:33:09,303] INFO Overriding the default acks to all since idempotence is enabled. (org.apache.kafka.clients.producer.KafkaProducer)
[2017-11-19 10:33:09,307] DEBUG Added sensor with name bufferpool-wait-time (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,310] DEBUG Added sensor with name buffer-exhausted-records (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,316] DEBUG Updated cluster metadata version 1 to Cluster(id = null, nodes = [localhost:9092 (id: -1 rack: null)], partitions = []) (org.apache.kafka.clients.Metadata)
[2017-11-19 10:33:09,322] DEBUG Added sensor with name produce-throttle-time (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,425] DEBUG Added sensor with name connections-closed: (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,426] DEBUG Added sensor with name connections-created: (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,426] DEBUG Added sensor with name bytes-sent-received: (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,426] DEBUG Added sensor with name bytes-sent: (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,426] DEBUG Added sensor with name bytes-received: (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,426] DEBUG Added sensor with name select-time: (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,426] DEBUG Added sensor with name io-time: (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,429] DEBUG Added sensor with name batch-size (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,430] DEBUG Added sensor with name compression-rate (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,430] DEBUG Added sensor with name queue-time (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,430] DEBUG Added sensor with name request-time (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,431] DEBUG Added sensor with name records-per-request (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,431] DEBUG Added sensor with name record-retries (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,431] DEBUG Added sensor with name errors (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,431] DEBUG Added sensor with name record-size-max (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,432] DEBUG Added sensor with name batch-split-rate (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,434] DEBUG Starting Kafka producer I/O thread. (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,435] INFO Kafka version : 0.11.0.0 (org.apache.kafka.common.utils.AppInfoParser)
[2017-11-19 10:33:09,435] INFO Kafka commitId : cb8625948210849f (org.apache.kafka.common.utils.AppInfoParser)
[2017-11-19 10:33:09,436] DEBUG Kafka producer started (org.apache.kafka.clients.producer.KafkaProducer)
[2017-11-19 10:33:09,437] DEBUG [TransactionalId test-trx-id123] Transition from state UNINITIALIZED to INITIALIZING (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,437] INFO [TransactionalId test-trx-id123] ProducerId set to -1 with epoch -1 (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,441] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=InitProducerIdRequest, transactionalId=test-trx-id123, transactionTimeoutMs=60000) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,444] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=FindCoordinatorRequest, coordinatorKey=test-trx-id123, coordinatorType=TRANSACTION) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,444] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=InitProducerIdRequest, transactionalId=test-trx-id123, transactionTimeoutMs=60000) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,546] DEBUG Initiating connection to node -1 at localhost:9092. (org.apache.kafka.clients.NetworkClient)
[2017-11-19 10:33:09,551] DEBUG Added sensor with name node--1.bytes-sent (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,551] DEBUG Added sensor with name node--1.bytes-received (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,551] DEBUG Added sensor with name node--1.latency (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,552] DEBUG Created socket with SO_RCVBUF = 32768, SO_SNDBUF = 131072, SO_TIMEOUT = 0 to node -1 (org.apache.kafka.common.network.Selector)
[2017-11-19 10:33:09,553] DEBUG Completed connection to node -1.  Fetching API versions. (org.apache.kafka.clients.NetworkClient)
[2017-11-19 10:33:09,553] DEBUG Initiating API versions fetch from node -1. (org.apache.kafka.clients.NetworkClient)
[2017-11-19 10:33:09,621] DEBUG Recorded API versions for node -1: (Produce(0): 0 to 3 [usable: 3], Fetch(1): 0 to 5 [usable: 5], Offsets(2): 0 to 2 [usable: 2], Metadata(3): 0 to 4 [usable: 4], LeaderAndIsr(4): 0 [usable: 0], StopReplica(5): 0 [usable: 0], UpdateMetadata(6): 0 to 3 [usable: 3], ControlledShutdown(7): 1 [usable: 1], OffsetCommit(8): 0 to 3 [usable: 3], OffsetFetch(9): 0 to 3 [usable: 3], FindCoordinator(10): 0 to 1 [usable: 1], JoinGroup(11): 0 to 2 [usable: 2], Heartbeat(12): 0 to 1 [usable: 1], LeaveGroup(13): 0 to 1 [usable: 1], SyncGroup(14): 0 to 1 [usable: 1], DescribeGroups(15): 0 to 1 [usable: 1], ListGroups(16): 0 to 1 [usable: 1], SaslHandshake(17): 0 [usable: 0], ApiVersions(18): 0 to 1 [usable: 1], CreateTopics(19): 0 to 2 [usable: 2], DeleteTopics(20): 0 to 1 [usable: 1], DeleteRecords(21): 0 [usable: 0], InitProducerId(22): 0 [usable: 0], OffsetForLeaderEpoch(23): 0 [usable: 0], AddPartitionsToTxn(24): 0 [usable: 0], AddOffsetsToTxn(25): 0 [usable: 0], EndTxn(26): 0 [usable: 0], WriteTxnMarkers(27): 0 [usable: 0], TxnOffsetCommit(28): 0 [usable: 0], DescribeAcls(29): 0 [usable: 0], CreateAcls(30): 0 [usable: 0], DeleteAcls(31): 0 [usable: 0], DescribeConfigs(32): 0 [usable: 0], AlterConfigs(33): 0 [usable: 0]) (org.apache.kafka.clients.NetworkClient)
[2017-11-19 10:33:09,621] DEBUG [TransactionalId test-trx-id123] Sending transactional request (type=FindCoordinatorRequest, coordinatorKey=test-trx-id123, coordinatorType=TRANSACTION) to node localhost:9092 (id: -1 rack: null) (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,623] DEBUG Initiating connection to node 0 at DESKTOP-I9N00F0:9092. (org.apache.kafka.clients.NetworkClient)
[2017-11-19 10:33:09,624] DEBUG Added sensor with name node-0.bytes-sent (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,625] DEBUG Added sensor with name node-0.bytes-received (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,625] DEBUG Added sensor with name node-0.latency (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,625] DEBUG Created socket with SO_RCVBUF = 32768, SO_SNDBUF = 131072, SO_TIMEOUT = 0 to node 0 (org.apache.kafka.common.network.Selector)
[2017-11-19 10:33:09,625] DEBUG Completed connection to node 0.  Fetching API versions. (org.apache.kafka.clients.NetworkClient)
[2017-11-19 10:33:09,625] DEBUG Initiating API versions fetch from node 0. (org.apache.kafka.clients.NetworkClient)
[2017-11-19 10:33:09,627] DEBUG Recorded API versions for node 0: (Produce(0): 0 to 3 [usable: 3], Fetch(1): 0 to 5 [usable: 5], Offsets(2): 0 to 2 [usable: 2], Metadata(3): 0 to 4 [usable: 4], LeaderAndIsr(4): 0 [usable: 0], StopReplica(5): 0 [usable: 0], UpdateMetadata(6): 0 to 3 [usable: 3], ControlledShutdown(7): 1 [usable: 1], OffsetCommit(8): 0 to 3 [usable: 3], OffsetFetch(9): 0 to 3 [usable: 3], FindCoordinator(10): 0 to 1 [usable: 1], JoinGroup(11): 0 to 2 [usable: 2], Heartbeat(12): 0 to 1 [usable: 1], LeaveGroup(13): 0 to 1 [usable: 1], SyncGroup(14): 0 to 1 [usable: 1], DescribeGroups(15): 0 to 1 [usable: 1], ListGroups(16): 0 to 1 [usable: 1], SaslHandshake(17): 0 [usable: 0], ApiVersions(18): 0 to 1 [usable: 1], CreateTopics(19): 0 to 2 [usable: 2], DeleteTopics(20): 0 to 1 [usable: 1], DeleteRecords(21): 0 [usable: 0], InitProducerId(22): 0 [usable: 0], OffsetForLeaderEpoch(23): 0 [usable: 0], AddPartitionsToTxn(24): 0 [usable: 0], AddOffsetsToTxn(25): 0 [usable: 0], EndTxn(26): 0 [usable: 0], WriteTxnMarkers(27): 0 [usable: 0], TxnOffsetCommit(28): 0 [usable: 0], DescribeAcls(29): 0 [usable: 0], CreateAcls(30): 0 [usable: 0], DeleteAcls(31): 0 [usable: 0], DescribeConfigs(32): 0 [usable: 0], AlterConfigs(33): 0 [usable: 0]) (org.apache.kafka.clients.NetworkClient)
[2017-11-19 10:33:09,727] DEBUG [TransactionalId test-trx-id123] Sending transactional request (type=InitProducerIdRequest, transactionalId=test-trx-id123, transactionTimeoutMs=60000) to node DESKTOP-I9N00F0:9092 (id: 0 rack: null) (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,780] INFO [TransactionalId test-trx-id123] ProducerId set to 12003 with epoch 0 (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,780] DEBUG [TransactionalId test-trx-id123] Transition from state INITIALIZING to READY (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,781] DEBUG [TransactionalId test-trx-id123] Transition from state READY to IN_TRANSACTION (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,783] DEBUG Sending metadata request (type=MetadataRequest, topics=test) to node -1 (org.apache.kafka.clients.NetworkClient)
[2017-11-19 10:33:09,794] DEBUG Updated cluster metadata version 2 to Cluster(id = roxZdQ7BSwCBrvTBlxyX6A, nodes = [DESKTOP-I9N00F0:9092 (id: 0 rack: null)], partitions = [Partition(topic = test, partition = 0, leader = 0, replicas = [0], isr = [0])]) (org.apache.kafka.clients.Metadata)
[2017-11-19 10:33:09,799] DEBUG [TransactionalId test-trx-id123] Begin adding new partition test-0 to transaction (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,809] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,810] DEBUG [TransactionalId test-trx-id123] Sending transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) to node DESKTOP-I9N00F0:9092 (id: 0 rack: null) (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,812] DEBUG [TransactionalId test-trx-id123] Transition from state IN_TRANSACTION to COMMITTING_TRANSACTION (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,813] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=EndTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, result=COMMIT) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,816] DEBUG [TransactionalId test-trx-id123] Successfully added partitions [test-0] to transaction (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,817] DEBUG Assigning sequence number 0 from producer (producerId=12003, epoch=0) to dequeued batch from partition test-0 bound for DESKTOP-I9N00F0:9092 (id: 0 rack: null). (org.apache.kafka.clients.producer.internals.RecordAccumulator)
[2017-11-19 10:33:09,821] DEBUG Added sensor with name topic.test.records-per-batch (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,821] DEBUG Added sensor with name topic.test.bytes (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,821] DEBUG Added sensor with name topic.test.compression-rate (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,821] DEBUG Added sensor with name topic.test.record-retries (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,821] DEBUG Added sensor with name topic.test.record-errors (org.apache.kafka.common.metrics.Metrics)
[2017-11-19 10:33:09,838] DEBUG Incremented sequence number for topic-partition test-0 to 1 (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,839] DEBUG [TransactionalId test-trx-id123] Sending transactional request (type=EndTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, result=COMMIT) to node DESKTOP-I9N00F0:9092 (id: 0 rack: null) (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,843] DEBUG [TransactionalId test-trx-id123] Transition from state COMMITTING_TRANSACTION to READY (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,844] INFO ================================ FIRST TRX ENDED ====================================== (kafka.examples.producer.SampleTest)
[2017-11-19 10:33:09,844] DEBUG [TransactionalId test-trx-id123] Transition from state READY to IN_TRANSACTION (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,844] DEBUG [TransactionalId test-trx-id123] Begin adding new partition test-0 to transaction (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,844] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,844] DEBUG [TransactionalId test-trx-id123] Transition from state IN_TRANSACTION to COMMITTING_TRANSACTION (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,844] DEBUG [TransactionalId test-trx-id123] Sending transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) to node DESKTOP-I9N00F0:9092 (id: 0 rack: null) (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,844] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=EndTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, result=COMMIT) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,847] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,867] DEBUG [TransactionalId test-trx-id123] Sending transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) to node DESKTOP-I9N00F0:9092 (id: 0 rack: null) (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,868] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,889] DEBUG [TransactionalId test-trx-id123] Sending transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) to node DESKTOP-I9N00F0:9092 (id: 0 rack: null) (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,890] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) (org.apache.kafka.clients.producer.internals.TransactionManager)
[2017-11-19 10:33:09,910] DEBUG [TransactionalId test-trx-id123] Sending transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) to node DESKTOP-I9N00F0:9092 (id: 0 rack: null) (org.apache.kafka.clients.producer.internals.Sender)
[2017-11-19 10:33:09,911] DEBUG [TransactionalId test-trx-id123] Enqueuing transactional request (type=AddPartitionsToTxnRequest, transactionalId=test-trx-id123, producerId=12003, producerEpoch=0, partitions=[test-0]) (org.apache.kafka.clients.producer.internals.TransactionManager)

在kafka 0.11.0.0,1.0.0上进行测试。 我按spring-kafka transactional

设置kafkaTemplate时出现同样的问题

我想念的是什么?

0 个答案:

没有答案