stian
stian

Reputation: 1987

how to configure a Akka Pub/Sub to run on same machine?

I am following the Distributed Publish Subscribe in Cluster example in Akka. However, I would like to run all the actor (publisher and subscribers) on the same node (my laptop). I am not sure if I understand how to configure that, could somebody help me? is it possible to use the runOn or should it be declared in a configuration file? Currently, I run into this error:

Caused by: akka.ConfigurationException: ActorSystem [akka://mySystem] 
needs to have a 'ClusterActorRefProvider' enabled in the 
configuration, currently uses [akka.actor.LocalActorRefProvider]

Upvotes: 5

Views: 2756

Answers (1)

rgcase
rgcase

Reputation: 646

Your error is telling you what the problem is. In your application.conf you should set akka.actor.provider = "akka.cluster.ClusterActorRefProvider". If you want to use a 1 node cluster on your laptop you should also set akka.cluster.min-nr-of-members = 1.

Upvotes: 5

Related Questions