use of io.zeebe.client.impl.ZeebeClientImpl in project zeebe by zeebe-io.
the class TopicSubscriptionTest method shouldCloseSubscriptionWhenAckFails.
@Test
public void shouldCloseSubscriptionWhenAckFails() {
// given
final long subscriberKey = 123L;
broker.stubTopicSubscriptionApi(subscriberKey);
broker.onExecuteCommandRequest(EventType.SUBSCRIPTION_EVENT, "ACKNOWLEDGE").respondWithError().errorCode(ErrorCode.REQUEST_PROCESSING_FAILURE).errorData("foo").register();
final TopicSubscription subscription = clientRule.topics().newSubscription(clientRule.getDefaultTopicName()).startAtHeadOfTopic().handler(DO_NOTHING).name(SUBSCRIPTION_NAME).open();
final RemoteAddress clientAddress = receivedSubscribeCommands().findFirst().get().getSource();
final int subscriptionCapacity = ((ZeebeClientImpl) client).getSubscriptionPrefetchCapacity();
// when
for (int i = 0; i < subscriptionCapacity; i++) {
broker.pushTopicEvent(clientAddress, subscriberKey, i, i);
}
// then
waitUntil(() -> subscription.isClosed());
assertThat(subscription.isClosed()).isTrue();
}
use of io.zeebe.client.impl.ZeebeClientImpl in project zeebe by zeebe-io.
the class ClientRule method before.
@Override
protected void before() throws Throwable {
clock = new ControlledActorClock();
client = new ZeebeClientImpl(properties, clock);
}
Aggregations