Akka: Improve choice of loading of ClusterReceptionist

Created on 16 Aug 2019  路  4Comments  路  Source: akka/akka

Currently, it loads the ClusterReceptions if provider=cluster and thereby require the akka-cluster-typed dependency:

https://github.com/akka/akka/blob/16f4971f64894d28be067e1b41231148bf286daa/akka-actor-typed/src/main/scala/akka/actor/typed/internal/receptionist/ReceptionistImpl.scala#L19-L32

There might be cases where one want to use Classic cluster but still only have the akka-actor-typed dependency. @marcospereira observed this when adding dependency to Lagom.

I think we should not fail here. Maybe log a warning, but fall back to LocalReceptionist. The drawback could be that the issue with missing akka-cluster-typed dependency is not noticed by the user, e.g. using Typed routers without noticing that they are local only.

discuss typed

All 4 comments

I think only logging is dangerous. Could it be a setting? i-know-typed-receptionist-is-node-local-in-my-untyped-cluster = true

Edit: I think we should clarify what is the actual use case where you'd want local typed but untyped cluster in the same app before changing this.

I think @marcospereira added akka-cluster-typed dependency?
Probably better to close this as invalid. I agree that it's better to fail for all use cases we know of so far.

I think @marcospereira added akka-cluster-typed dependency?

I did. It was added wherever both akka-actor-typed and akka-cluster were added.

good, I think that is the right thing to do. Closing this without action.

Was this page helpful?
0 / 5 - 0 ratings