Akka & OSGI Confusion with Documentation and other stackflow questions

I am going through OSGI at akka documentation https://doc.akka.io/docs/akka/2.5/additional/osgi.html, I have a confusion over " Intended Use" section.

We have a few requirements, please help me to validate the documentation and my understanding.

  1. Akka can be used in OSGI - Confirmed
  2. There must be only one ActorSystem loaded by the Akka OSGI module. Other OSGI module should not load or create a new ActorSystem.

As per documentation it says “”“This means that the approach of offering an ActorSystem as a service to which Actors can be deployed dynamically via other bundles is not recommended”""

  1. Can I implement an Actor(s) in other OSGI Module 2 [note, not ActorSystem], which that OSGI Module 2 can be loaded after the ActorSystem Initialised? Can I instantiate the actor from OSGI Module 2 and add the actor instance under ActorSystem? I don’t see anything wrong here, as we can create Actor by using Class Type, OSGI provides registry services which can be useful to Register Actor Classes. Can someone help me explain the problem?

I am not understanding why ““Actors can be deployed dynamically via other bundles is not recommended””" part of the documentation.

Thank you, I am implementing an large scale IoT application, we expect the protocol drivers to be implemented as OSGI module, each protocol drivers can be loaded only on need basis, and the protocol drivers shall have 1 to 10 Actors, which should be dynamically added into ActorSystem. I will ensure only one ActorSystem throughout the JVM process, I have clustering on Akka System as well.

Forgot to add link to StackOverflow, https://stackoverflow.com/questions/20163507/how-can-osgi-and-akka-benefit-from-each-other-how-is-this-structured, as per StackOverflow discussion, we could have actors from other module as well. Please correct me if I am wrong.

Hi @gopalakrishnan-subramani, I have the same need. What was the conclusion? Did you go with this approach? If not, was there any alternative?

Thanks!