0

If node crashes and at that point of time messages are queued up in mailbox then how will those messages be reprocessed? If they can not be reprocessed then how can we say akka programming model is fault tolerant. This is the most basic use case for which we have to use persistent queues right now.

Marut Singh
  • 345
  • 1
  • 3
  • 10

2 Answers2

4

The messages won't be processed and will be lost; Akka does not guarantee message delivery - this is explicitly stated in the beginning of its documentation. However, this does not preclude one to make the program fault-tolerant. One of the simplest ways to do so would be to implement messages with acknowledgements and make actors re-send messages which were not acknowledged.

Vladimir Matveev
  • 120,085
  • 34
  • 287
  • 296
  • Though I agree with your logic here but wish it was so simple..If it was so simple there was no need to use a microservice framework like akka. This is one of the biggest reason for it not to be as popular as it should be. Akka was supposed to solve these problems for me and until they do their popularity graph will pretty much be stagnant and people will prefer brokers like kafka – Marut Singh Nov 12 '16 at 09:18
  • @MarutSingh, you are confusing different things. Akka is not a message broker and it is not a microservices framework, it is an implementation of a *concurrency paradigm*. Like CPS (channels and coroutines, think Go) or bare threads. Akka is not intended as a substitute for message buses; actually, they may very well complement each other. For example, I worked on projects where we used RabbitMQ as a medium between different processes, while the processes themselves were built with Akka internally and also used Akka for clustering. – Vladimir Matveev Nov 12 '16 at 15:49
  • Do not agree with your thought here..Akka is a microservice framework at least now and Typesafe is promoting it as such. Microservices need discovery, load balancing , communication and akka provides most of the services out of the box. It is not a substitute for message but but it uses message bus internally..only thing is you do not install any external software as it is peer to peer. It is same as vert.x.If you used akka for clustering then where does RabbitMQ come into picture? – Marut Singh Nov 12 '16 at 15:57
  • Right now I do not see a use cases where RabbitMQ and akka will co exist except for the cases where different stacks are being used to create services so akka is not part of every microservice in the architecture – Marut Singh Nov 12 '16 at 15:57
  • 1
    I repeat again, Akka is just an implementation of an actor-based concurrency paradigm with some extensions (e.g. networking and clustering), it is not a microservices framework. It also does not use a message bus, which is an entirely different concept: for example, message bus usually works in a pub-sub scenario, when multiple clients listen to events coming from multiple sources. The actor model is completely opposite: actors are sending messages directly to each other. Therefore, it provides completely different guarantees than message brokers and it solves different tasks. – Vladimir Matveev Nov 12 '16 at 21:47
  • As for the project I've mentioned, we connect multiple Akka-based applications through RabbitMQ, which handles routing, pub-sub, message persistence and queuing in case one of the endpoints breaks down. Each application is a Scala service which uses Akka as a backbone and uses clustering to provide fault tolerance in case of node failures. Naturally, there are message resends all over the place because the message-based architecture inherently does not guarantee message delivery. – Vladimir Matveev Nov 12 '16 at 21:52
0

Entire typesafe stack is built around microservices.. If you have doubt then read their presentations.. Akka streams Alla HTTP they all are in this direction... Seems your view of Microservice is different from mine... Despite that you missed the main point.. Distributed fault tolerant architecture problem was supposed to be solved by Akka.. If you are using rabbitmq then you are not going to get all benefits of akka.. Like location transparency.. Actor heiraarchy..do post your architecture diagram to Akka forums and see what response you get

Marut Singh
  • 345
  • 1
  • 3
  • 10
  • Entire typesafe stack is built around microservices.. If you have doubt then read their presentations.. Akka streams Alla HTTP they all are in this direction... Seems your view of Microservice is different from mine... Despite that you missed the main point.. Distributed fault tolerant architecture problem was supposed to be solved by Akka.. If you are using rabbitmq then you are not going to get all benefits of akka.. Like location transparency.. Actor heiraarchy..do post your architecture diagram to Akka forums and see what response you get – Marut Singh Nov 13 '16 at 02:42