@Override protected Throwable getThrowable() { return new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); }
private Exception bulkheadFullException() { return new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); }
public static void isCallPermitted(Bulkhead bulkhead) { if(!bulkhead.isCallPermitted()) { throw new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); } } }
@Override public void onSubscribe(Subscription subscription) { if (SubscriptionHelper.setOnce(this, subscription)) { if (acquireCallPermit()) { childSubscriber.onSubscribe(this); } else { cancel(); childSubscriber.onSubscribe(this); childSubscriber.onError(new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName()))); } } }
private Object handleOther(MethodInvocation invocation, io.github.resilience4j.bulkhead.Bulkhead bulkhead, RecoveryFunction<?> recoveryFunction) throws Throwable { boolean permission = bulkhead.isCallPermitted(); if (!permission) { Throwable t = new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); return recoveryFunction.apply(t); } try { if (Thread.interrupted()) { throw new IllegalStateException("Thread was interrupted during permission wait"); } return invocation.proceed(); } catch (Exception e) { return recoveryFunction.apply(e); } finally { bulkhead.onComplete(); } } }
promise.completeExceptionally(new BulkheadFullException(String.format("Bulkhead '%s' is open", bulkhead.getName())));
Throwable t = new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); handleRecovery(down, t);
} else { final CompletableFuture promise = new CompletableFuture<>(); Throwable t = new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); try { promise.complete(recoveryFunction.apply(t));
private Exception bulkheadFullException() { return new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); }
@Override public void onSubscribe(Subscription subscription) { if (SubscriptionHelper.setOnce(this, subscription)) { if (acquireCallPermit()) { childSubscriber.onSubscribe(this); } else { cancel(); childSubscriber.onSubscribe(this); childSubscriber.onError(new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName()))); } } }
private Object handleOther(MethodInvocation invocation, io.github.resilience4j.bulkhead.Bulkhead bulkhead, RecoveryFunction<?> recoveryFunction) throws Throwable { boolean permission = bulkhead.isCallPermitted(); if (!permission) { Throwable t = new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); return recoveryFunction.apply(t); } try { if (Thread.interrupted()) { throw new IllegalStateException("Thread was interrupted during permission wait"); } return invocation.proceed(); } catch (Exception e) { return recoveryFunction.apply(e); } finally { bulkhead.onComplete(); } } }
Throwable t = new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); handleRecovery(down, t);
} else { final CompletableFuture promise = new CompletableFuture<>(); Throwable t = new BulkheadFullException(String.format("Bulkhead '%s' is full", bulkhead.getName())); try { promise.complete(recoveryFunction.apply(t));