use of io.camunda.zeebe.util.exception.UncheckedExecutionException in project zeebe by camunda.
the class Broker method internalStart.
private void internalStart() {
try {
brokerContext = brokerStartupActor.start().join();
healthCheckService.setBrokerStarted();
startFuture.complete(this);
} catch (final Exception bootStrapException) {
final BrokerCfg brokerCfg = getConfig();
LOG.error("Failed to start broker {}!", brokerCfg.getCluster().getNodeId(), bootStrapException);
final UncheckedExecutionException exception = new UncheckedExecutionException("Failed to start broker", bootStrapException);
startFuture.completeExceptionally(exception);
throw exception;
}
}
use of io.camunda.zeebe.util.exception.UncheckedExecutionException in project zeebe by camunda.
the class BrokerClientImpl method close.
@Override
public void close() {
if (isClosed) {
return;
}
isClosed = true;
LOG.debug("Closing gateway broker client ...");
doAndLogException(topologyManager::close);
LOG.debug("topology manager closed");
if (jobAvailableSubscription != null) {
jobAvailableSubscription.close();
}
if (ownsActorScheduler) {
try {
actorScheduler.stop().get(15, TimeUnit.SECONDS);
} catch (final InterruptedException ie) {
Thread.currentThread().interrupt();
throw new UncheckedExecutionException(ERROR_MSG_STOP_FAILED, ie);
} catch (final ExecutionException | TimeoutException e) {
throw new UncheckedExecutionException(ERROR_MSG_STOP_FAILED, e);
}
}
LOG.debug("Gateway broker client closed.");
}
use of io.camunda.zeebe.util.exception.UncheckedExecutionException in project zeebe by camunda.
the class ClusteringRule method before.
@Override
protected void before() throws IOException {
partitionLatch = new CountDownLatch(partitionCount);
// create brokers
for (int nodeId = 0; nodeId < clusterSize; nodeId++) {
getBroker(nodeId);
}
final var contactPoints = brokerCfgs.values().stream().map(BrokerCfg::getNetwork).map(NetworkCfg::getInternalApi).map(SocketBindingCfg::getAddress).map(NetUtil::toSocketAddressString).toArray(String[]::new);
for (int nodeId = 0; nodeId < clusterSize; nodeId++) {
final var brokerCfg = getBrokerCfg(nodeId);
setInitialContactPoints(contactPoints).accept(brokerCfg);
}
// create gateway
gateway = createGateway();
gateway.start();
// create client
client = createClient();
try {
waitUntilBrokersStarted();
waitForPartitionReplicationFactor();
LOG.info("Full replication factor");
waitUntilBrokersInTopology();
LOG.info("All brokers in topology {}", getTopologyFromClient());
} catch (final Exception e) {
// If the previous waits timeouts, the brokers are not closed automatically.
after();
throw new UncheckedExecutionException("Cluster start failed", e);
}
}
use of io.camunda.zeebe.util.exception.UncheckedExecutionException in project zeebe by zeebe-io.
the class Broker method internalStart.
private void internalStart() {
try {
brokerContext = brokerStartupActor.start().join();
healthCheckService.setBrokerStarted();
startFuture.complete(this);
} catch (final Exception bootStrapException) {
final BrokerCfg brokerCfg = getConfig();
LOG.error("Failed to start broker {}!", brokerCfg.getCluster().getNodeId(), bootStrapException);
final UncheckedExecutionException exception = new UncheckedExecutionException("Failed to start broker", bootStrapException);
startFuture.completeExceptionally(exception);
throw exception;
}
}
use of io.camunda.zeebe.util.exception.UncheckedExecutionException in project zeebe by camunda-cloud.
the class ClusteringRule method before.
@Override
protected void before() throws IOException {
partitionLatch = new CountDownLatch(partitionCount);
// create brokers
for (int nodeId = 0; nodeId < clusterSize; nodeId++) {
getBroker(nodeId);
}
final var contactPoints = brokerCfgs.values().stream().map(BrokerCfg::getNetwork).map(NetworkCfg::getInternalApi).map(SocketBindingCfg::getAddress).map(NetUtil::toSocketAddressString).toArray(String[]::new);
for (int nodeId = 0; nodeId < clusterSize; nodeId++) {
final var brokerCfg = getBrokerCfg(nodeId);
setInitialContactPoints(contactPoints).accept(brokerCfg);
}
// create gateway
gateway = createGateway();
gateway.start().join();
// create client
client = createClient();
try {
waitUntilBrokersStarted();
waitForPartitionReplicationFactor();
LOG.info("Full replication factor");
waitUntilBrokersInTopology();
LOG.info("All brokers in topology {}", getTopologyFromClient());
} catch (final Exception e) {
// If the previous waits timeouts, the brokers are not closed automatically.
after();
throw new UncheckedExecutionException("Cluster start failed", e);
}
}
Aggregations