codingsplash
codingsplash

Reputation: 5045

Multiple actor systems for an application

This article talks about how we should not create 'too' many actor systems. But the docs say:

An ActorSystem is a heavyweight structure that will allocate 1…N Threads, so create one per logical application.

I am unable to understand what is the real issue here with using multiple actor systems in an application. Also, is it possible for actors from different actor system to message each other?

Upvotes: 8

Views: 3746

Answers (1)

Stefano Bonetti
Stefano Bonetti

Reputation: 9023

There is no issue with using multiple systems. There is a potential issue with creating too many of them. The reason is that with an ActorSystem comes some non-negligible overhead - mainly because each one would allocate its own fork-join pool.

I recommend you read this blogpost for more info.

Actors from different ActorSystems can message each other, but AFAIK this needs to happen through remoting. This counts as yet another reason why system segregation doesn't really make sense as a local pattern.

Upvotes: 9

Related Questions