sb.defaultRequestTimeout(Duration.of(30, ChronoUnit.SECONDS));
@Override protected void configure(ServerBuilder sb) throws Exception { // Used for testing if changing the timeout dynamically works. sb.service("/sleep", ThriftCallService.of(sleepService) .decorate(DynamicTimeoutService::new) .decorate(THttpService.newDecorator())); // Used for testing if disabling the timeout dynamically works. sb.service("/fakeSleep", ThriftCallService.of(fakeSleepService) .decorate(TimeoutDisablingService::new) .decorate(THttpService.newDecorator())); sb.defaultRequestTimeout(Duration.ofSeconds(1)); } };
sb.defaultRequestTimeout(Duration.of(30, ChronoUnit.SECONDS));