Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading data from _transaction_state topic in Kafka 0.11.0.1

I want to read meta data for transaction (which is supported in Kafka 0.11.0.1) so that I can figure out that whether the transaction for a particular transactional ID has been committed or not. Currently I am getting the key and value from _transactional_state topic but it is in some encoded format. Below are some same key/value I received when I polled __transaction_state topic: key = 10000000mmm, value = � �����+'���������)

like image 394
Shrinivas Kulkarni Avatar asked Mar 07 '23 10:03

Shrinivas Kulkarni


1 Answers

just like what has been done in Kafka how to read from __consumer_offsets topic

echo "exclude.internal.topics=false" > consumer.config

kafka-console-consumer --consumer.config consumer.config --formatter "kafka.coordinator.transaction.TransactionLog\$TransactionLogMessageFormatter" --bootstrap-server localhost:9092 --topic __transaction_state --from-beginning

like image 60
Chris Avatar answered May 04 '23 23:05

Chris