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

Ancillary Marten stores don't necessarily use the correct message database in inbox/outbox operations #1025

Open
jeremydmiller opened this issue Sep 2, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@jeremydmiller
Copy link
Member

jeremydmiller commented Sep 2, 2024

The envelopes are going to the correct database schema, but the DurableReceiver and durable sending agents aren't using the correct databases.

Only really an issue for local queues where messages are sent as part of a message using the ancillary store

@jeremydmiller jeremydmiller added the bug Something isn't working label Sep 2, 2024
@jeremydmiller jeremydmiller added this to the 3.0 milestone Sep 2, 2024
@jeremydmiller
Copy link
Member Author

Use this test in the code to bring out the problem:

    [Fact]
    public async Task try_to_use_the_session_transactional_middleware_end_to_end_through_a_queue()
    {
        var message = new SpawnPlayerMessage(Guid.NewGuid().ToString());
        var tracked = await theHost.InvokeMessageAndWaitAsync(message, timeoutInMilliseconds:60000);
        var envelopeId = tracked.Executed.SingleEnvelope<PlayerMessage>().Id;
    
        var store = theHost.DocumentStore<IPlayerStore>();
        using var session = store.QuerySession();
        var player = await session.LoadAsync<Player>(message.Id);
    
        player.ShouldNotBeNull();
    
        var runtime = theHost.GetRuntime();
        var messageStore = runtime.AncillaryStores.OfType<IAncillaryMessageStore<IPlayerStore>>().Single();
        var envelope = (await messageStore.Admin.AllIncomingAsync()).Single(x => x.Id == envelopeId);
        envelope.Status.ShouldBe(EnvelopeStatus.Handled);
        envelope.OwnerId.ShouldBe(TransportConstants.AnyNode);
    }

Basic issue is that the ancillary store is being more or less ignored and still using the main postgres message store. No big deal if you're all on the same database, but still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant