use of io.zeebe.transport.ClientTransport in project zeebe by zeebe-io.
the class PartitionManagerService method start.
@Override
public void start(ServiceStartContext startContext) {
final ClientTransport managementClient = managementClientInjector.getValue();
service = new PartitionManagerImpl(memberListServiceInjector.getValue(), managementClient);
}
use of io.zeebe.transport.ClientTransport in project zeebe by zeebe-io.
the class ClientRule method interruptBrokerConnections.
public void interruptBrokerConnections() {
final ClientTransport transport = ((ZeebeClientImpl) client).getTransport();
transport.interruptAllChannels();
}
use of io.zeebe.transport.ClientTransport in project zeebe by zeebe-io.
the class ClusterManagerContextService method start.
@Override
public void start(ServiceStartContext startContext) {
final ClientTransport clientTransport = managementClientInjector.getValue();
final BufferingServerTransport serverTransport = managementApiTransportInjector.getValue();
final ActorScheduler actorScheduler = startContext.getScheduler();
final LogStreamsManager logStreamsManager = logStreamsManagerInjector.getValue();
final WorkflowRequestMessageHandler workflowRequestMessageHandler = workflowRequestMessageHandlerInjector.getValue();
context = new ClusterManagerContext();
context.setGossip(gossipInjector.getValue());
context.setActorScheduler(actorScheduler);
context.setManagementClient(clientTransport);
context.setReplicationClient(replicationClientInjector.getValue());
context.setServerTransport(serverTransport);
context.setMemberListService(memberListServiceInjector.getValue());
context.setLogStreamsManager(logStreamsManager);
context.setWorkflowRequestMessageHandler(workflowRequestMessageHandler);
}
use of io.zeebe.transport.ClientTransport in project zeebe by zeebe-io.
the class CreateTopicTest method shouldRejectPartitionCreationAndNotBreak.
@Test
public void shouldRejectPartitionCreationAndNotBreak() {
// given
final ClientTransport transport = apiRule.getTransport();
final RemoteAddress remoteAddress = transport.registerRemoteAndAwaitChannel(BROKER_MGMT_ADDRESS);
final ClientOutput output = transport.getOutput();
final CreatePartitionRequest partitionMessage = new CreatePartitionRequest();
final DirectBuffer topicName = BufferUtil.wrapString("foo");
final int partition1 = 142;
final int partition2 = 143;
partitionMessage.topicName(topicName);
partitionMessage.partitionId(partition1);
// => should create partition
doRepeatedly(() -> output.sendRequest(remoteAddress, partitionMessage)).until(r -> r != null);
// => should be rejected/ignored
doRepeatedly(() -> output.sendRequest(remoteAddress, partitionMessage)).until(r -> r != null);
// when creating another partition
partitionMessage.partitionId(partition2);
doRepeatedly(() -> output.sendRequest(remoteAddress, partitionMessage)).until(r -> r != null);
// then this should be successful (i.e. the rejected request should not have jammed the broker)
waitUntil(() -> arePublished(partition1, partition2));
}
use of io.zeebe.transport.ClientTransport in project zeebe by zeebe-io.
the class ClientConfigurationTest method shouldConfigureKeepAlive.
@Test
public void shouldConfigureKeepAlive() {
// given
final Properties props = new Properties();
props.put(ClientProperties.CLIENT_TCP_CHANNEL_KEEP_ALIVE_PERIOD, Long.toString(KEEP_ALIVE_TIMEOUT));
final Duration expectedTimeout = Duration.ofMillis(KEEP_ALIVE_TIMEOUT);
// when
final ZeebeClient client = ZeebeClient.create(props);
// then
final ClientTransport transport = ((ZeebeClientImpl) client).getTransport();
assertThat(transport.getChannelKeepAlivePeriod()).isEqualTo(expectedTimeout);
}
Aggregations