This is a post(set of questions really) regarding the implications of
at-most-once(maybe-once) delivery reliability offered by akka actors on
APIs and software based on akka. From my understanding, even messages sent
by actors to self can be lost.
Till now, I have been in scenarios where delivery guarantee is not
necessary so life was good. But now, I need reliability from my service at
least to the extent that a subscriber should know that a message has been
lost.
1. If messages can be lost in actor system, and akka-streams are based on
actors, does that mean akka-streams are leaky? Thats pretty scary to think
about. Specifically does a Flow(or GraphStage) ensure that stream entities
are not lost?
For example, is the below code(based on Source.single doc
<https://doc.akka.io/docs/akka/2.5/stream/operators/Source/single.html>)
guaranteed to print `[hello]`?
import akka.stream.*;
CompletionStage<List<String>> future = Source.single("hello").runWith(
Sink.seq(), materializer);
CompletableFuture<List<String>> completableFuture = future.
toCompletableFuture();
completableFuture.thenAccept(result -> System.out.println(result));
2. If messages can be lost in actor system, and akka-http is based on
actors, does that mean akka-http APIs, lets say websocket API randomly
drops messages.
For example, in:
http.singleWebSocketRequest(WebSocketRequest.create(
"wss://api.example.com"), flow, mat)
is it at least guaranteed that my flow will reliably receive everything
on the websocket in order?
3. In actor world, I would have a sequence number on each message and let
the receiver actor take remedial measures on a lost(probably never because
of at-most-once reliability issues so far) sequence number. In case we live
in a dystopian world where the answers to 1. and 2. are yes, this wouldn't
work because the external web service I consume does not implement sequence
numbers. Because any sequence number I generate within the application will
only add sequence numbers to messages that are not already lost. Is this a
correct understanding?
--
*****************************************************************************************************
** New discussion forum: https://discuss.akka.io/ replacing akka-user
google-group soon.
** This group will soon be put into read-only mode, and replaced by
discuss.akka.io
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
*****************************************************************************************************
>>>>>>>>>>
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.