ExecutorService + Wildfly
See original GitHub issueSince 2.0.1, Failsafe supports ExecutorService. I have tried to use ManagedExecutorService (JEE -Wildfly) to use FailSafe in WildFly. The circuit break never switchs to half-open state.
private final CircuitBreaker<Object> circuitBreakerRuntime = new CircuitBreaker<>()
.onOpen(this::openCircuit)
.onClose(this::closeCircuit)
.onHalfOpen(this::halfCircuit)
.withFailureThreshold(2)
.withSuccessThreshold(1)
.withDelay(Duration.ofSeconds(10));
...
@Resource
private ManagedExecutorService managedExecutorService;
...
Failsafe
.with(hsmFailureService.getCircuitBreakerRuntime(), hsmFailureService.getRetryPolicyInit())
.with(managedExecutorService)
.onSuccess(e -> log.debug("HSM is ONLINE"))
.onFailure(e -> log.warn("Retrying FAILED"))
.get(hsmConfigInitializer::initProvider);
Any ideas?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
how to use ExecutorService in webapp - JBoss.org
1. is this the right way to use ExecutorService? Is there any better way to do it? Since I'm already inside a webapp...
Read more >managed-executor-service - WildFly Full 19 Model Reference
completed-task-count The approximate total number of tasks that have completed execution. Attribute, Value. Type, LONG. Nillable, false. Expressions ...
Read more >Jboss Java EE container and an ExecutorService
ExecutorService es = Executors.newFixedThreadPool(10);. I now want to re-use the same solution within an EJB bean but am unsure how to correctly ...
Read more >How to use the ManagedExecutorService to submit tasks
Since WildFly 23, the managed executors in the EE subsystem are capable of identifying tasks which are running for a long unexpected time,...
Read more >Chapter 9. Concurrency Utilities Red Hat JBoss Enterprise ...
Managed executor service (javax.enterprise.concurrent.ManagedExecutorService) allows Java EE applications to submit tasks for asynchronous execution. JBoss ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yea, being more explicit wouldn’t be a bad thing, it would just be a bit more verbose. I would probably prefer to offer more explicit wrapping but only in one direction:
…since wrapping the other way is harder to reason about when considering pre and post execution behaviors in policies, and wrapping in both directions is just more to explain. In this case
Failsafe.with(fallback, retryPolicy, circuitBreaker)
could still be shorthand but at least we’d have an explicit alternative to compare it to.Reading your comments (see it)
It was not a problem of asynchronous call but I must generate executions to enable half-open state. (tricky 😃)
Thx for your help.