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

Fix missing default query configuration #317

Merged
merged 2 commits into from
Sep 14, 2023

Conversation

Arkatufus
Copy link
Contributor

When using HOCON configuration, default query configuration were not injected properly

Changes

  • Inject default query configuration into SqlReadJournalProvider
  • Standardize SqlReadJournalProvider
  • Add sample project

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the source of the fix - could you help me @Arkatufus ?

@@ -68,7 +67,7 @@ public class SqlReadJournal :
_mat = Materializer.CreateSystemMaterializer(
context: system,
settings: ActorMaterializerSettings.Create(system),
namePrefix: $"l2db-query-mat{configPath}");
namePrefix: $"l2db-query-mat-{Guid.NewGuid():N}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the fix here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was not the fix, the SqlReadJournal is a bit different in that it creates a materializer, which none of our other read journal does.

It tries to create a single materializer by appending the "config path".

The problem is that "config path" were never being passed into the provider, the provider was created through reflection magic and none of the activator code passes in the "config path".

So I just remove that ambiguous code and replace it with a GUID

_system = system;
_config = config;
_configPath = configPath;
_config = config.WithFallback(SqlPersistence.DefaultQueryConfiguration);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, ok thank you.

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) September 14, 2023 18:30
@Aaronontheweb Aaronontheweb merged commit 6cc080d into akkadotnet:dev Sep 14, 2023
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants