use of io.camunda.zeebe.gateway.impl.configuration.NetworkCfg in project zeebe by camunda.
the class NetworkCfgTest method shouldNotFailOnLongHostName.
@Test
public void shouldNotFailOnLongHostName() {
// given
final var port = 1000;
final var hostName = RandomString.make(139);
final var networkCfg = new NetworkCfg();
networkCfg.setPort(port);
// when
networkCfg.setHost(hostName);
final var socketAddress = networkCfg.toSocketAddress();
// then
assertThat(socketAddress).isEqualTo(new InetSocketAddress(hostName, port));
}
use of io.camunda.zeebe.gateway.impl.configuration.NetworkCfg in project zeebe by camunda.
the class UnavailableBrokersTest method setUp.
@BeforeAll
static void setUp() throws IOException {
final NetworkCfg networkCfg = new NetworkCfg().setPort(SocketUtil.getNextAddress().getPort());
final GatewayCfg config = new GatewayCfg().setNetwork(networkCfg);
config.init(InetAddress.getLocalHost().getHostName());
cluster = AtomixCluster.builder().build();
cluster.start();
actorScheduler = ActorScheduler.newActorScheduler().build();
actorScheduler.start();
gateway = new Gateway(new GatewayCfg().setNetwork(networkCfg), cluster.getMessagingService(), cluster.getMembershipService(), cluster.getEventService(), actorScheduler);
gateway.start();
final String gatewayAddress = NetUtil.toSocketAddressString(networkCfg.toSocketAddress());
client = ZeebeClient.newClientBuilder().gatewayAddress(gatewayAddress).usePlaintext().build();
}
use of io.camunda.zeebe.gateway.impl.configuration.NetworkCfg in project zeebe by zeebe-io.
the class UnavailableBrokersTest method setUp.
@BeforeAll
static void setUp() throws IOException {
final NetworkCfg networkCfg = new NetworkCfg().setPort(SocketUtil.getNextAddress().getPort());
final GatewayCfg config = new GatewayCfg().setNetwork(networkCfg);
config.init(InetAddress.getLocalHost().getHostName());
cluster = AtomixCluster.builder().build();
cluster.start();
actorScheduler = ActorScheduler.newActorScheduler().build();
actorScheduler.start();
gateway = new Gateway(new GatewayCfg().setNetwork(networkCfg), cluster.getMessagingService(), cluster.getMembershipService(), cluster.getEventService(), actorScheduler);
gateway.start().join();
final String gatewayAddress = NetUtil.toSocketAddressString(networkCfg.toSocketAddress());
client = ZeebeClient.newClientBuilder().gatewayAddress(gatewayAddress).usePlaintext().build();
}
use of io.camunda.zeebe.gateway.impl.configuration.NetworkCfg in project zeebe by camunda-cloud.
the class StandaloneGatewaySecurityTest method createGatewayCfg.
private GatewayCfg createGatewayCfg() {
final var gatewayAddress = SocketUtil.getNextAddress();
final var clusterAddress = SocketUtil.getNextAddress();
return new GatewayCfg().setNetwork(new NetworkCfg().setHost(gatewayAddress.getHostName()).setPort(gatewayAddress.getPort())).setCluster(new ClusterCfg().setHost(clusterAddress.getHostName()).setPort(clusterAddress.getPort()).setSecurity(new SecurityCfg().setEnabled(true).setCertificateChainPath(certificate.certificate()).setPrivateKeyPath(certificate.privateKey())));
}
use of io.camunda.zeebe.gateway.impl.configuration.NetworkCfg in project zeebe by zeebe-io.
the class StandaloneGatewaySecurityTest method createGatewayCfg.
private GatewayCfg createGatewayCfg() {
final var gatewayAddress = SocketUtil.getNextAddress();
final var clusterAddress = SocketUtil.getNextAddress();
return new GatewayCfg().setNetwork(new NetworkCfg().setHost(gatewayAddress.getHostName()).setPort(gatewayAddress.getPort())).setCluster(new ClusterCfg().setHost(clusterAddress.getHostName()).setPort(clusterAddress.getPort()).setSecurity(new SecurityCfg().setEnabled(true).setCertificateChainPath(certificate.certificate()).setPrivateKeyPath(certificate.privateKey())));
}
Aggregations