use of io.zeebe.containers.ZeebeNode in project zeebe by zeebe-io.
the class AdvertisedAddressTest method shouldCommunicateOverProxy.
@Test
void shouldCommunicateOverProxy() {
// given
cluster.start();
// gossip
try (final var client = cluster.newClientBuilder().build()) {
final Topology topology = client.newTopologyRequest().send().join(5, TimeUnit.SECONDS);
final var messageSend = client.newPublishMessageCommand().messageName("test").correlationKey("test").send().join(5, TimeUnit.SECONDS);
// then - gateway can talk to the broker
final var proxiedPorts = cluster.getBrokers().values().stream().map(ZeebeNode::getInternalHost).map(host -> toxiproxy.getProxy(host, ZeebePort.COMMAND.getPort())).map(ContainerProxy::getOriginalProxyPort).collect(Collectors.toList());
TopologyAssert.assertThat(topology).isComplete(3, 1).hasBrokerSatisfying(b -> assertThat(b.getAddress()).as("broker 0 advertises the correct proxied address").isEqualTo(TOXIPROXY_NETWORK_ALIAS + ":" + proxiedPorts.get(0))).hasBrokerSatisfying(b -> assertThat(b.getAddress()).as("broker 1 advertises the correct proxied address").isEqualTo(TOXIPROXY_NETWORK_ALIAS + ":" + proxiedPorts.get(1))).hasBrokerSatisfying(b -> assertThat(b.getAddress()).as("broker 2 advertises the correct proxied address").isEqualTo(TOXIPROXY_NETWORK_ALIAS + ":" + proxiedPorts.get(2)));
assertThat(messageSend.getMessageKey()).isPositive();
}
}
use of io.zeebe.containers.ZeebeNode in project zeebe by camunda-cloud.
the class AdvertisedAddressTest method shouldCommunicateOverProxy.
@Test
void shouldCommunicateOverProxy() {
// given
cluster.start();
// gossip
try (final var client = cluster.newClientBuilder().build()) {
final Topology topology = client.newTopologyRequest().send().join(5, TimeUnit.SECONDS);
final var messageSend = client.newPublishMessageCommand().messageName("test").correlationKey("test").send().join(5, TimeUnit.SECONDS);
// then - gateway can talk to the broker
final var proxiedPorts = cluster.getBrokers().values().stream().map(ZeebeNode::getInternalHost).map(host -> toxiproxy.getProxy(host, ZeebePort.COMMAND.getPort())).map(ContainerProxy::getOriginalProxyPort).collect(Collectors.toList());
TopologyAssert.assertThat(topology).isComplete(3, 1).hasBrokerSatisfying(b -> assertThat(b.getAddress()).as("broker 0 advertises the correct proxied address").isEqualTo(TOXIPROXY_NETWORK_ALIAS + ":" + proxiedPorts.get(0))).hasBrokerSatisfying(b -> assertThat(b.getAddress()).as("broker 1 advertises the correct proxied address").isEqualTo(TOXIPROXY_NETWORK_ALIAS + ":" + proxiedPorts.get(1))).hasBrokerSatisfying(b -> assertThat(b.getAddress()).as("broker 2 advertises the correct proxied address").isEqualTo(TOXIPROXY_NETWORK_ALIAS + ":" + proxiedPorts.get(2)));
assertThat(messageSend.getMessageKey()).isPositive();
}
}
use of io.zeebe.containers.ZeebeNode in project zeebe by camunda.
the class AdvertisedAddressTest method shouldCommunicateOverProxy.
@Test
void shouldCommunicateOverProxy() {
// given
cluster.start();
// gossip
try (final var client = cluster.newClientBuilder().build()) {
final Topology topology = client.newTopologyRequest().send().join(5, TimeUnit.SECONDS);
final var messageSend = client.newPublishMessageCommand().messageName("test").correlationKey("test").send().join(5, TimeUnit.SECONDS);
// then - gateway can talk to the broker
final var proxiedPorts = cluster.getBrokers().values().stream().map(ZeebeNode::getInternalHost).map(host -> toxiproxy.getProxy(host, ZeebePort.COMMAND.getPort())).map(ContainerProxy::getOriginalProxyPort).collect(Collectors.toList());
TopologyAssert.assertThat(topology).isComplete(3, 1).hasBrokerSatisfying(b -> assertThat(b.getAddress()).as("broker 0 advertises the correct proxied address").isEqualTo(TOXIPROXY_NETWORK_ALIAS + ":" + proxiedPorts.get(0))).hasBrokerSatisfying(b -> assertThat(b.getAddress()).as("broker 1 advertises the correct proxied address").isEqualTo(TOXIPROXY_NETWORK_ALIAS + ":" + proxiedPorts.get(1))).hasBrokerSatisfying(b -> assertThat(b.getAddress()).as("broker 2 advertises the correct proxied address").isEqualTo(TOXIPROXY_NETWORK_ALIAS + ":" + proxiedPorts.get(2)));
assertThat(messageSend.getMessageKey()).isPositive();
}
}
Aggregations