Search in sources :

Example 1 with DefaultErrorMessages

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);
    }
}
Also used : DefaultErrorMessages(io.confluent.ksql.rest.DefaultErrorMessages) KsqlException(io.confluent.ksql.util.KsqlException) NoSuchFileException(java.nio.file.NoSuchFileException) SerializationException(org.apache.kafka.common.errors.SerializationException) IncompatibleKsqlCommandVersionException(io.confluent.ksql.rest.server.resources.IncompatibleKsqlCommandVersionException) OutOfOrderSequenceException(org.apache.kafka.common.errors.OutOfOrderSequenceException) ProducerFencedException(org.apache.kafka.common.errors.ProducerFencedException) KsqlException(io.confluent.ksql.util.KsqlException) TimeoutException(org.apache.kafka.common.errors.TimeoutException) AuthorizationException(org.apache.kafka.common.errors.AuthorizationException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) TimeoutException(org.apache.kafka.common.errors.TimeoutException)

Aggregations

DefaultErrorMessages (io.confluent.ksql.rest.DefaultErrorMessages)1 IncompatibleKsqlCommandVersionException (io.confluent.ksql.rest.server.resources.IncompatibleKsqlCommandVersionException)1 KsqlException (io.confluent.ksql.util.KsqlException)1 IOException (java.io.IOException)1 NoSuchFileException (java.nio.file.NoSuchFileException)1 ExecutionException (java.util.concurrent.ExecutionException)1 AuthorizationException (org.apache.kafka.common.errors.AuthorizationException)1 OutOfOrderSequenceException (org.apache.kafka.common.errors.OutOfOrderSequenceException)1 ProducerFencedException (org.apache.kafka.common.errors.ProducerFencedException)1 SerializationException (org.apache.kafka.common.errors.SerializationException)1 TimeoutException (org.apache.kafka.common.errors.TimeoutException)1