pekko icon indicating copy to clipboard operation
pekko copied to clipboard

Configuring persistence plugins at runtime for `EventSourcedBehavior`

Open ptrdom opened this issue 1 year ago • 4 comments

One bit of functionality that is present in Classic persistence but missing in Typed is the capability to configure persistence plugins at runtime. Typical case where this is beneficial is for segregation of data between different tenants in multi-tenant environments.

This should be rather straightforward to implement, I could work on it if such feature would be accepted.

ptrdom avatar Oct 02 '24 20:10 ptrdom

There are API methods in EventSourcedBehavior.

Example: https://github.com/apache/pekko/blob/main/persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/scaladsl/EventSourcedBehavior.scala#L163

pjfanning avatar Oct 02 '24 20:10 pjfanning

Providing plugin ID at runtime is not the same as dynamic configuration of the plugin, AFAIK.

ptrdom avatar Oct 02 '24 20:10 ptrdom

I don't have a problem with having a similar RuntimePluginConfig functionality for EventSourcedBehavior. @ptrdom Would you be interested in doing a PR for this?

pjfanning avatar Oct 02 '24 20:10 pjfanning

Yes, will do!

ptrdom avatar Oct 02 '24 20:10 ptrdom