use of io.camunda.zeebe.gateway.impl.broker.cluster.BrokerTopologyManagerImpl in project zeebe by camunda.
the class TopologyUpdateTest method setUp.
@Before
public void setUp() {
members = new HashSet<>();
topologyManager = new BrokerTopologyManagerImpl(() -> members);
actorSchedulerRule.submitActor(topologyManager);
}
use of io.camunda.zeebe.gateway.impl.broker.cluster.BrokerTopologyManagerImpl in project zeebe by zeebe-io.
the class BrokerClientTest method setUp.
@Before
public void setUp() {
final GatewayCfg configuration = new GatewayCfg();
configuration.getCluster().setHost("0.0.0.0").setPort(SocketUtil.getNextAddress().getPort()).setContactPoint(NetUtil.toSocketAddressString(broker.getSocketAddress())).setRequestTimeout(Duration.ofSeconds(3));
configuration.init();
final ControlledActorClock clock = new ControlledActorClock();
final var stubAddress = Address.from(broker.getCurrentStubHost(), broker.getCurrentStubPort());
final var stubNode = Node.builder().withAddress(stubAddress).build();
final var listOfNodes = List.of(stubNode);
atomixCluster = AtomixCluster.builder().withPort(SocketUtil.getNextAddress().getPort()).withMemberId("gateway").withClusterId("cluster").withMembershipProvider(BootstrapDiscoveryProvider.builder().withNodes(listOfNodes).build()).build();
atomixCluster.start().join();
client = new BrokerClientImpl(configuration, atomixCluster.getMessagingService(), atomixCluster.getMembershipService(), atomixCluster.getEventService(), clock);
final BrokerClusterStateImpl topology = new BrokerClusterStateImpl();
topology.addPartitionIfAbsent(START_PARTITION_ID);
topology.setPartitionLeader(START_PARTITION_ID, 0, 1);
topology.addBrokerIfAbsent(0);
topology.setBrokerAddressIfPresent(0, stubAddress.toString());
((BrokerTopologyManagerImpl) client.getTopologyManager()).setTopology(topology);
}
use of io.camunda.zeebe.gateway.impl.broker.cluster.BrokerTopologyManagerImpl in project zeebe by zeebe-io.
the class TopologyUpdateTest method setUp.
@Before
public void setUp() {
members = new HashSet<>();
topologyManager = new BrokerTopologyManagerImpl(() -> members);
actorSchedulerRule.submitActor(topologyManager);
}
use of io.camunda.zeebe.gateway.impl.broker.cluster.BrokerTopologyManagerImpl in project zeebe by camunda-cloud.
the class BrokerClientTest method setUp.
@Before
public void setUp() {
final GatewayCfg configuration = new GatewayCfg();
configuration.getCluster().setHost("0.0.0.0").setPort(SocketUtil.getNextAddress().getPort()).setContactPoint(NetUtil.toSocketAddressString(broker.getSocketAddress())).setRequestTimeout(Duration.ofSeconds(3));
configuration.init();
final ControlledActorClock clock = new ControlledActorClock();
final var stubAddress = Address.from(broker.getCurrentStubHost(), broker.getCurrentStubPort());
final var stubNode = Node.builder().withAddress(stubAddress).build();
final var listOfNodes = List.of(stubNode);
atomixCluster = AtomixCluster.builder().withPort(SocketUtil.getNextAddress().getPort()).withMemberId("gateway").withClusterId("cluster").withMembershipProvider(BootstrapDiscoveryProvider.builder().withNodes(listOfNodes).build()).build();
atomixCluster.start().join();
client = new BrokerClientImpl(configuration, atomixCluster.getMessagingService(), atomixCluster.getMembershipService(), atomixCluster.getEventService(), clock);
final BrokerClusterStateImpl topology = new BrokerClusterStateImpl();
topology.addPartitionIfAbsent(START_PARTITION_ID);
topology.setPartitionLeader(START_PARTITION_ID, 0, 1);
topology.addBrokerIfAbsent(0);
topology.setBrokerAddressIfPresent(0, stubAddress.toString());
((BrokerTopologyManagerImpl) client.getTopologyManager()).setTopology(topology);
}
use of io.camunda.zeebe.gateway.impl.broker.cluster.BrokerTopologyManagerImpl in project zeebe by camunda-cloud.
the class TopologyUpdateTest method setUp.
@Before
public void setUp() {
members = new HashSet<>();
topologyManager = new BrokerTopologyManagerImpl(() -> members);
actorSchedulerRule.submitActor(topologyManager);
}
Aggregations