use of io.camunda.zeebe.gateway.impl.broker.BrokerClientImpl in project zeebe by camunda.
the class GatewayIntegrationTest method setup.
@Before
public void setup() {
final GatewayCfg configuration = new GatewayCfg();
final var brokerCfg = broker.getBrokerCfg();
final var internalApi = brokerCfg.getNetwork().getInternalApi();
configuration.getCluster().setHost("0.0.0.0").setPort(SocketUtil.getNextAddress().getPort()).setContactPoint(internalApi.toString()).setRequestTimeout(Duration.ofSeconds(10));
configuration.init();
final ControlledActorClock clock = new ControlledActorClock();
final ClusterServices clusterServices = broker.getClusterServices();
client = new BrokerClientImpl(configuration, clusterServices.getMessagingService(), clusterServices.getMembershipService(), clusterServices.getEventService(), clock);
}
use of io.camunda.zeebe.gateway.impl.broker.BrokerClientImpl 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.BrokerClientImpl in project zeebe by camunda-cloud.
the class GatewayIntegrationTest method setup.
@Before
public void setup() {
final GatewayCfg configuration = new GatewayCfg();
final var brokerCfg = broker.getBrokerCfg();
final var internalApi = brokerCfg.getNetwork().getInternalApi();
configuration.getCluster().setHost("0.0.0.0").setPort(SocketUtil.getNextAddress().getPort()).setContactPoint(internalApi.toString()).setRequestTimeout(Duration.ofSeconds(10));
configuration.init();
final ControlledActorClock clock = new ControlledActorClock();
final ClusterServices clusterServices = broker.getClusterServices();
client = new BrokerClientImpl(configuration, clusterServices.getMessagingService(), clusterServices.getMembershipService(), clusterServices.getEventService(), clock);
}
use of io.camunda.zeebe.gateway.impl.broker.BrokerClientImpl 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.BrokerClientImpl in project zeebe by zeebe-io.
the class GatewayIntegrationTest method setup.
@Before
public void setup() {
final GatewayCfg configuration = new GatewayCfg();
final var brokerCfg = broker.getBrokerCfg();
final var internalApi = brokerCfg.getNetwork().getInternalApi();
configuration.getCluster().setHost("0.0.0.0").setPort(SocketUtil.getNextAddress().getPort()).setContactPoint(internalApi.toString()).setRequestTimeout(Duration.ofSeconds(10));
configuration.init();
final ControlledActorClock clock = new ControlledActorClock();
final ClusterServices clusterServices = broker.getClusterServices();
client = new BrokerClientImpl(configuration, clusterServices.getMessagingService(), clusterServices.getMembershipService(), clusterServices.getEventService(), clock);
}
Aggregations