use of io.zeebe.containers.ZeebeTopologyWaitStrategy in project zeebe-test-container by camunda-community-hub.
the class ClusterWithEmbeddedGatewaysExampleTest method getConfiguredClusterBroker.
/**
* Will configure the broker in {@code brokers} at index {@code index} for a basic cluster that
* contains all {@code brokers}. Note that depending on the machine on which you're running, the
* containers may be quite slow, so make sure to provide them enough cores/memory.
*
* @param index the index of the broker to configure and return in {@code brokers}
* @param brokers all the brokers part of the cluster
* @return the broker at index {@code index} in {@code brokers}, configured for clustering
*/
private ZeebeContainer getConfiguredClusterBroker(final int index, final List<ZeebeContainer> brokers) {
final int clusterSize = brokers.size();
final String initialContactPoints = brokers.stream().map(ZeebeBrokerNode::getInternalClusterAddress).collect(Collectors.joining(","));
final ZeebeContainer broker = brokers.get(index);
return broker.withTopologyCheck(new ZeebeTopologyWaitStrategy().forBrokersCount(clusterSize).forReplicationFactor(clusterSize)).withStartupTimeout(Duration.ofMinutes(5)).withEnv("ZEEBE_BROKER_CLUSTER_NODEID", String.valueOf(index)).withEnv("ZEEBE_BROKER_CLUSTER_CLUSTERSIZE", String.valueOf(clusterSize)).withEnv("ZEEBE_BROKER_CLUSTER_REPLICATIONFACTOR", String.valueOf(clusterSize)).withEnv("ZEEBE_BROKER_CLUSTER_INITIALCONTACTPOINTS", initialContactPoints);
}
use of io.zeebe.containers.ZeebeTopologyWaitStrategy in project zeebe by zeebe-io.
the class Ipv6IntegrationTest method configureGatewayContainer.
private void configureGatewayContainer(final ZeebeGatewayContainer gateway, final String initialContactPoint) {
final String address = getIpv6AddressForIndex(CLUSTER_SIZE);
gateway.withEnv("ZEEBE_GATEWAY_CLUSTER_CONTACTPOINT", initialContactPoint).withTopologyCheck(new ZeebeTopologyWaitStrategy().forBrokersCount(CLUSTER_SIZE).forPartitionsCount(PARTITION_COUNT).forReplicationFactor(REPLICATION_FACTOR)).withNetwork(network).withNetworkAliases(NETWORK_ALIAS).withEnv("ZEEBE_GATEWAY_NETWORK_HOST", INADDR6_ANY).withEnv("ZEEBE_GATEWAY_CLUSTER_HOST", address).withCreateContainerCmdModifier(createContainerCmd -> createContainerCmd.withIpv6Address(address).withHostName(address));
}
use of io.zeebe.containers.ZeebeTopologyWaitStrategy in project zeebe by camunda-cloud.
the class Ipv6IntegrationTest method configureGatewayContainer.
private void configureGatewayContainer(final ZeebeGatewayContainer gateway, final String initialContactPoint) {
final String address = getIpv6AddressForIndex(CLUSTER_SIZE);
gateway.withEnv("ZEEBE_GATEWAY_CLUSTER_CONTACTPOINT", initialContactPoint).withTopologyCheck(new ZeebeTopologyWaitStrategy().forBrokersCount(CLUSTER_SIZE).forPartitionsCount(PARTITION_COUNT).forReplicationFactor(REPLICATION_FACTOR)).withNetwork(network).withNetworkAliases(NETWORK_ALIAS).withEnv("ZEEBE_GATEWAY_NETWORK_HOST", INADDR6_ANY).withEnv("ZEEBE_GATEWAY_CLUSTER_HOST", address).withCreateContainerCmdModifier(createContainerCmd -> createContainerCmd.withIpv6Address(address).withHostName(address));
}
use of io.zeebe.containers.ZeebeTopologyWaitStrategy in project zeebe by camunda.
the class Ipv6IntegrationTest method configureGatewayContainer.
private void configureGatewayContainer(final ZeebeGatewayContainer gateway, final String initialContactPoint) {
final String address = getIpv6AddressForIndex(CLUSTER_SIZE);
gateway.withEnv("ZEEBE_GATEWAY_CLUSTER_CONTACTPOINT", initialContactPoint).withTopologyCheck(new ZeebeTopologyWaitStrategy().forBrokersCount(CLUSTER_SIZE).forPartitionsCount(PARTITION_COUNT).forReplicationFactor(REPLICATION_FACTOR)).withNetwork(network).withNetworkAliases(NETWORK_ALIAS).withEnv("ZEEBE_GATEWAY_NETWORK_HOST", INADDR6_ANY).withEnv("ZEEBE_GATEWAY_CLUSTER_HOST", address).withCreateContainerCmdModifier(createContainerCmd -> createContainerCmd.withIpv6Address(address).withHostName(address));
}
Aggregations