Search in sources :

Example 1 with KafkaGroupLeaderElector

use of io.confluent.kafka.schemaregistry.leaderelector.kafka.KafkaGroupLeaderElector in project schema-registry by confluentinc.

the class KafkaSchemaRegistry method init.

@Override
public void init() throws SchemaRegistryException {
    try {
        kafkaStore.init();
    } catch (StoreInitializationException e) {
        throw new SchemaRegistryInitializationException("Error initializing kafka store while initializing schema registry", e);
    }
    try {
        config.checkBootstrapServers();
        log.info("Joining schema registry with Kafka-based coordination");
        leaderElector = new KafkaGroupLeaderElector(config, myIdentity, this);
        leaderElector.init();
    } catch (SchemaRegistryStoreException e) {
        throw new SchemaRegistryInitializationException("Error electing leader while initializing schema registry", e);
    } catch (SchemaRegistryTimeoutException e) {
        throw new SchemaRegistryInitializationException(e);
    }
}
Also used : StoreInitializationException(io.confluent.kafka.schemaregistry.storage.exceptions.StoreInitializationException) KafkaGroupLeaderElector(io.confluent.kafka.schemaregistry.leaderelector.kafka.KafkaGroupLeaderElector) SchemaRegistryStoreException(io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryStoreException) SchemaRegistryInitializationException(io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryInitializationException) SchemaRegistryTimeoutException(io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryTimeoutException)

Aggregations

SchemaRegistryInitializationException (io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryInitializationException)1 SchemaRegistryStoreException (io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryStoreException)1 SchemaRegistryTimeoutException (io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryTimeoutException)1 KafkaGroupLeaderElector (io.confluent.kafka.schemaregistry.leaderelector.kafka.KafkaGroupLeaderElector)1 StoreInitializationException (io.confluent.kafka.schemaregistry.storage.exceptions.StoreInitializationException)1