use of io.zeebe.containers.ZeebeContainer in project zeebe by zeebe-io.
the class ContainerState method start.
public void start(final boolean enableDebug, final boolean withRemoteDebugging) {
final String contactPoint;
broker = new ZeebeContainer(brokerImage).withEnv("ZEEBE_LOG_LEVEL", "DEBUG").withEnv("ZEEBE_BROKER_NETWORK_MAXMESSAGESIZE", "128KB").withEnv("ZEEBE_BROKER_DATA_LOGSEGMENTSIZE", "64MB").withEnv("ZEEBE_BROKER_DATA_SNAPSHOTPERIOD", "1m").withEnv("ZEEBE_BROKER_DATA_LOGINDEXDENSITY", "1").withZeebeData(volume).withNetwork(network);
this.withRemoteDebugging = withRemoteDebugging;
if (withRemoteDebugging) {
RemoteDebugger.configureContainer(broker);
LOG.info("================================================");
LOG.info("About to start broker....");
LOG.info("The broker will wait for a debugger to connect to it at port " + RemoteDebugger.DEFAULT_REMOTE_DEBUGGER_PORT + ". It will wait for " + RemoteDebugger.DEFAULT_START_TIMEOUT.toString());
LOG.info("================================================");
}
if (enableDebug) {
broker = broker.withEnv("ZEEBE_DEBUG", "true");
}
Failsafe.with(CONTAINER_START_RETRY_POLICY).run(() -> broker.self().start());
if (gatewayImage == null) {
contactPoint = broker.getExternalGatewayAddress();
} else {
gateway = new ZeebeGatewayContainer(gatewayImage).withEnv("ZEEBE_GATEWAY_CLUSTER_CONTACTPOINT", broker.getInternalClusterAddress()).withEnv("ZEEBE_LOG_LEVEL", "DEBUG").withNetwork(network);
Failsafe.with(CONTAINER_START_RETRY_POLICY).run(() -> gateway.self().start());
contactPoint = gateway.getExternalGatewayAddress();
}
client = ZeebeClient.newClientBuilder().gatewayAddress(contactPoint).usePlaintext().build();
partitionsActuatorClient = new PartitionsActuatorClient(broker.getExternalMonitoringAddress());
}
use of io.zeebe.containers.ZeebeContainer in project zeebe by camunda-cloud.
the class BrokerMonitoringEndpointTest method setUpClass.
@BeforeClass
public static void setUpClass() {
sutBroker = new ZeebeContainer(ZeebeTestContainerDefaults.defaultTestImage());
sutBroker.start();
final Integer monitoringPort = sutBroker.getMappedPort(ZeebePort.MONITORING.getPort());
final String containerIPAddress = sutBroker.getExternalHost();
brokerServerSpec = new RequestSpecBuilder().setContentType(ContentType.TEXT).setBaseUri("http://" + containerIPAddress).setPort(monitoringPort).addFilter(new ResponseLoggingFilter()).addFilter(new RequestLoggingFilter()).build();
}
use of io.zeebe.containers.ZeebeContainer in project zeebe by camunda.
the class BrokerMonitoringEndpointTest method setUpClass.
@BeforeClass
public static void setUpClass() {
sutBroker = new ZeebeContainer(ZeebeTestContainerDefaults.defaultTestImage());
sutBroker.start();
final Integer monitoringPort = sutBroker.getMappedPort(ZeebePort.MONITORING.getPort());
final String containerIPAddress = sutBroker.getExternalHost();
brokerServerSpec = new RequestSpecBuilder().setContentType(ContentType.TEXT).setBaseUri("http://" + containerIPAddress).setPort(monitoringPort).addFilter(new ResponseLoggingFilter()).addFilter(new RequestLoggingFilter()).build();
}
use of io.zeebe.containers.ZeebeContainer in project zeebe-test-container by camunda-community-hub.
the class ZeebeClusterBuilder method createBrokers.
private void createBrokers() {
for (int i = 0; i < brokersCount; i++) {
final ZeebeBrokerNode<?> broker;
if (useEmbeddedGateway) {
final ZeebeContainer container = new ZeebeContainer(brokerImageName);
configureGateway(container);
broker = container;
gateways.put(String.valueOf(i), container);
} else {
broker = new ZeebeBrokerContainer(brokerImageName);
}
configureBroker(broker, i);
brokers.put(i, broker);
}
// since initial contact points has to container all known brokers, we can only configure it
// AFTER the base broker configuration
configureBrokerInitialContactPoints();
}
use of io.zeebe.containers.ZeebeContainer in project zeebe-test-container by camunda-community-hub.
the class RestartWithExtractedDataExampleTest method shouldRestartWithGeneratedData.
/**
* The test here will start a process based on the definition deployed in the previous test.
*
* <p>The data here is copied to avoid further modifying it. We could also use a {@link
* io.zeebe.containers.ZeebeHostData} if that was not a constraint.
*/
@Test
@Order(2)
@Timeout(value = 5, unit = TimeUnit.MINUTES)
void shouldRestartWithGeneratedData() {
// given
final Path dataPath = Paths.get(tempDir.resolve(DATA_DIR).toString(), ZeebeDefaults.getInstance().getDefaultDataPath());
// when
try (final ZeebeContainer container = new ZeebeContainer().withCopyFileToContainer(MountableFile.forHostPath(dataPath), ZeebeDefaults.getInstance().getDefaultDataPath())) {
// when
container.start();
final ProcessInstanceResult result = createProcessInstance(container);
// then
assertThat(result).isNotNull();
}
}
Aggregations