use of io.confluent.ksql.rest.DefaultErrorMessages in project ksql by confluentinc.
the class KsqlRestoreCommandTopic method createTransactionalProducer.
private Producer<byte[], byte[]> createTransactionalProducer() {
try {
final Producer<byte[], byte[]> kafkaProducer = kafkaProducerSupplier.get();
kafkaProducer.initTransactions();
return kafkaProducer;
} catch (final TimeoutException e) {
final DefaultErrorMessages errorMessages = new DefaultErrorMessages();
throw new KsqlException(errorMessages.transactionInitTimeoutErrorMessage(e), e);
} catch (final Exception e) {
throw new KsqlException("Failed to initialize topic transactions.", e);
}
}
Aggregations