Hi,
What Boyang meant, is this consumer config: *isolation.level, *which
default is *read_uncommitted*,
so the consumer will be able to read all messages with or without committed.
ref: https://kafka.apache.org/documentation/#consumerconfigs_isolation.level
Thanks
Luke
On Wed, Jan 27, 2021 at 2:50 AM Boyang Chen <reluctanthero104@gmail.com>
wrote:
> Have you set consumer isolation level? If it was set to uncommitted, it
> will be able to see messages you produced, without commitTransaction call
>
> On Tue, Jan 26, 2021 at 7:43 AM 积淀智慧 <dream_zph@163.com> wrote:
>
> > Hello, everybody,
> >
> >
> > I'm running some tests while using Kafka transactions.
> >
> >
> > test 1 :
> > String msg = "matt test";
> > String topic = "test";
> > producer.beginTransaction();
> > producer.send(new ProducerRecord(topic, "0", msg.toString()));
> > producer.send(new ProducerRecord(topic, "1", msg.toString()));
> > producer.send(new ProducerRecord(topic, "2", msg.toString()));
> > for (; ; ) { }
> >
> >
> > test result:Messages also arrive at the consumer without delay.
> >
> >
> > My question is, why can data be committed without commitTransaction.
> >
> >
> > thx
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
What Boyang meant, is this consumer config: *isolation.level, *which
default is *read_uncommitted*,
so the consumer will be able to read all messages with or without committed.
ref: https://kafka.apache.org/documentation/#consumerconfigs_isolation.level
Thanks
Luke
On Wed, Jan 27, 2021 at 2:50 AM Boyang Chen <reluctanthero104@gmail.com>
wrote:
> Have you set consumer isolation level? If it was set to uncommitted, it
> will be able to see messages you produced, without commitTransaction call
>
> On Tue, Jan 26, 2021 at 7:43 AM 积淀智慧 <dream_zph@163.com> wrote:
>
> > Hello, everybody,
> >
> >
> > I'm running some tests while using Kafka transactions.
> >
> >
> > test 1 :
> > String msg = "matt test";
> > String topic = "test";
> > producer.beginTransaction();
> > producer.send(new ProducerRecord(topic, "0", msg.toString()));
> > producer.send(new ProducerRecord(topic, "1", msg.toString()));
> > producer.send(new ProducerRecord(topic, "2", msg.toString()));
> > for (; ; ) { }
> >
> >
> > test result:Messages also arrive at the consumer without delay.
> >
> >
> > My question is, why can data be committed without commitTransaction.
> >
> >
> > thx
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
Comments
Post a Comment