use of io.camunda.zeebe.broker.system.configuration.SocketBindingCfg 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.broker.system.configuration.SocketBindingCfg 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);
}
}
use of io.camunda.zeebe.broker.system.configuration.SocketBindingCfg in project zeebe by zeebe-io.
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