You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"In Helidon Message, we don't have the transaction support to batch bunch of messages for publishing. So that the consumer can read with read_comitted isolation level"
"As a producer I need to batch bunch of messages are single transaction, in apache-kafka it can be done using commitTransaction()"
Sample code of apache kafka client
KafkaProducer<String, String> producer = new KafkaProducer<>(configProps);
producer.initTransactions();
producer.beginTransaction();
ProducerRecord<String, String> record;
try {
long timeInMillies = System.currentTimeMillis();
for (int i = 1; i <= 10; i++) {
record = new ProducerRecord<>(topic, "Hai_" + timeInMillies + "_" + i);
producer.send(record);
log.info("Sending the message --> " + record.value());
Thread.sleep(1000);
}
log.info("Commiting the transaction");
producer.commitTransaction();
} catch (KafkaException kafkaExec) {
producer.abortTransaction();
kafkaExec.printStackTrace();
}
producer.close();
The text was updated successfully, but these errors were encountered:
santhoshpt
changed the title
Need transaction grouping for batch of records in KafkaProcuder
Need transaction support to group batch of records in message publisher - ReactiveMessaging/KafkaConnector
Feb 15, 2022
Environment Details
Problem Description
Sample code of apache kafka client
The text was updated successfully, but these errors were encountered: