Search in sources :

Example 6 with ServerTransport

use of io.zeebe.transport.ServerTransport in project zeebe by zeebe-io.

the class ZeebeClientTest method shouldCloseAllConnectionsOnClose.

@Test
public void shouldCloseAllConnectionsOnClose() throws Exception {
    // given
    final ServerTransport serverTransport = broker.getTransport();
    final TopicSubscription subscription = openSubscription();
    final LoggingChannelListener channelListener = new LoggingChannelListener();
    serverTransport.registerChannelListener(channelListener).join();
    // when
    client.close();
    // then
    assertThat(subscription.isClosed()).isTrue();
    // listener invocation on close is asynchronous
    waitUntil(() -> channelListener.connectionState.size() == 1);
    assertThat(channelListener.connectionState).containsExactly(ConnectionState.CLOSED);
}
Also used : TopicSubscription(io.zeebe.client.event.TopicSubscription) ServerTransport(io.zeebe.transport.ServerTransport) Test(org.junit.Test)

Aggregations

ServerTransport (io.zeebe.transport.ServerTransport)6 StreamProcessorService (io.zeebe.broker.logstreams.processor.StreamProcessorService)3 StreamProcessorController (io.zeebe.logstreams.processor.StreamProcessorController)3 TypedStreamEnvironment (io.zeebe.broker.logstreams.processor.TypedStreamEnvironment)2 TypedStreamProcessor (io.zeebe.broker.logstreams.processor.TypedStreamProcessor)2 LogStream (io.zeebe.logstreams.log.LogStream)2 ActorScheduler (io.zeebe.util.sched.ActorScheduler)2 RequestTopologyHandler (io.zeebe.broker.clustering.handler.RequestTopologyHandler)1 RemoveTopicSubscriptionHandler (io.zeebe.broker.event.handler.RemoveTopicSubscriptionHandler)1 TopicSubscriptionService (io.zeebe.broker.event.processor.TopicSubscriptionService)1 IncidentStreamProcessor (io.zeebe.broker.incident.processor.IncidentStreamProcessor)1 CreateWorkflowResponseSender (io.zeebe.broker.system.deployment.handler.CreateWorkflowResponseSender)1 RequestPartitionsMessageHandler (io.zeebe.broker.system.log.RequestPartitionsMessageHandler)1 SystemPartitionManager (io.zeebe.broker.system.log.SystemPartitionManager)1 TaskSubscriptionManager (io.zeebe.broker.task.TaskSubscriptionManager)1 TaskInstanceStreamProcessor (io.zeebe.broker.task.processor.TaskInstanceStreamProcessor)1 CommandResponseWriter (io.zeebe.broker.transport.clientapi.CommandResponseWriter)1 WorkflowInstanceStreamProcessor (io.zeebe.broker.workflow.processor.WorkflowInstanceStreamProcessor)1 TopicSubscription (io.zeebe.client.event.TopicSubscription)1 Dispatcher (io.zeebe.dispatcher.Dispatcher)1