Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sharing same MongoClient instance across different plugin instances #345

Open
yahor-filipchyk opened this issue May 14, 2020 · 0 comments

Comments

@yahor-filipchyk
Copy link

Each Persistence plugin instantiation creates its own MongoClient instance, which comes with its own connection pool, server heartbeats and other not so cheap resources.

While this might be a rare use case, our app keeps every client's data in a separate database so we are using akka's akka.persistence.RuntimePluginConfig to supply persistence plugin config with overwritten database name at runtime. The plugin ids are also created at runtime based on the client identifier. This all works nicely except for pretty much uncontrolled usage of mongo connections.

To better control the usage of mongo servers it'd be nice to have separate control over the mongodb driver instantiation(-s).

I'd suggest wrapping MongoClient in a separate actor system extension with some default id and allow overwriting the extension id in each plugin instance to support the client per plugin instance scenario (the current state).

If this becomes a pressing problem for us very soon I'd be happy to contribute, otherwise will be waiting for new versions of the plugin, but I'm sure there are other more important things for you and other contributors to prioritize first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant