From 914a94e40524d4232ee5a0da6570f531c5252d9b Mon Sep 17 00:00:00 2001 From: Jorge Gomez Date: Wed, 31 Mar 2021 04:14:12 -0300 Subject: [PATCH] ActorSinkWithAckExample Ack message (#30127) Using the example does not work in Java, because it seems that `Sink` compares by equality, no by class. --- .../docs/akka/stream/typed/ActorSinkWithAckExample.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/akka-stream-typed/src/test/java/docs/akka/stream/typed/ActorSinkWithAckExample.java b/akka-stream-typed/src/test/java/docs/akka/stream/typed/ActorSinkWithAckExample.java index 9eeacbf8a4..5888eb07f5 100644 --- a/akka-stream-typed/src/test/java/docs/akka/stream/typed/ActorSinkWithAckExample.java +++ b/akka-stream-typed/src/test/java/docs/akka/stream/typed/ActorSinkWithAckExample.java @@ -17,7 +17,9 @@ public class ActorSinkWithAckExample { // #actor-sink-ref-with-backpressure - class Ack {} + enum Ack { + INSTANCE; + } interface Protocol {} @@ -58,7 +60,6 @@ public class ActorSinkWithAckExample { final ActorRef actorRef = // spawned actor null; // #hidden - final Ack ackMessage = new Ack(); final Complete completeMessage = new Complete(); final Sink sink = @@ -66,7 +67,7 @@ public class ActorSinkWithAckExample { actorRef, (responseActorRef, element) -> new Message(responseActorRef, element), (responseActorRef) -> new Init(responseActorRef), - ackMessage, + Ack.INSTANCE, completeMessage, (exception) -> new Fail(exception));