* Add java.time.Duration support in the JavaDSL in akka-actor module #24646 * add deprecation and change retry
This commit is contained in:
parent
e18382bb0f
commit
6a9fa1946d
35 changed files with 419 additions and 80 deletions
|
|
@ -6,12 +6,11 @@ package jdocs.circuitbreaker;
|
|||
|
||||
import akka.actor.ActorRef;
|
||||
import akka.actor.ReceiveTimeout;
|
||||
import akka.actor.AbstractActor.Receive;
|
||||
import akka.actor.AbstractActor;
|
||||
import akka.event.Logging;
|
||||
import akka.event.LoggingAdapter;
|
||||
import akka.pattern.CircuitBreaker;
|
||||
import scala.concurrent.duration.Duration;
|
||||
import java.time.Duration;
|
||||
|
||||
public class TellPatternJavaActor extends AbstractActor {
|
||||
|
||||
|
|
@ -23,7 +22,7 @@ public class TellPatternJavaActor extends AbstractActor {
|
|||
this.target = targetActor;
|
||||
this.breaker = new CircuitBreaker(
|
||||
getContext().dispatcher(), getContext().system().scheduler(),
|
||||
5, Duration.create(10, "s"), Duration.create(1, "m"))
|
||||
5, Duration.ofSeconds(10), Duration.ofMinutes(1))
|
||||
.onOpen(new Runnable() {
|
||||
public void run() {
|
||||
notifyMeOnOpen();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue