Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 28 17:44
    wojteksuwala opened #159
  • Jan 27 20:54
    jeremydmiller opened #158
  • Jan 27 20:52
    jeremydmiller edited #132
  • Jan 27 17:51

    jeremydmiller on http

    Moved the parameter matching in… successful usage of strong rout… Can deal with parsed route argu… and 3 more (compare)

  • Jan 27 15:57
    dgrozenok commented #154
  • Jan 27 15:55
    dgrozenok commented #154
  • Jan 27 15:51
    dgrozenok commented #154
  • Jan 27 13:06
    droosma opened #157
  • Jan 26 19:58
    jeremydmiller closed #152
  • Jan 26 19:58
    jeremydmiller commented #152
  • Jan 26 19:58

    jeremydmiller on main

    issue #152 - fluentvalidation a… (compare)

  • Jan 26 19:58
    jeremydmiller closed #155
  • Jan 26 19:57

    jeremydmiller on main

    fix the typo - Sql to Sqs (compare)

  • Jan 26 19:57
    jeremydmiller closed #153
  • Jan 26 19:52
    jeremydmiller commented #153
  • Jan 26 19:01
    jeremydmiller opened #156
  • Jan 26 16:09

    jeremydmiller on http

    Endpoint discovery is working, … additional notes on http handli… (compare)

  • Jan 26 13:18

    jeremydmiller on http

    Spiked in the Json writing code… Having EndpointGraph depend on … First smoke test of discovering… and 2 more (compare)

  • Jan 25 21:41
    jeremydmiller edited #11
  • Jan 25 18:30
    Vertygo opened #155
Ivan Milosavljevic
@Vertygo
Any thoughts about CodeOpinions take on In-Memory bus https://www.youtube.com/watch?v=KCvsk5tTP3w
Matt Mercurio
@mattmercurio
His video was timely for me. I had just installed Hangfire the night before for my application. But I shifted gears and used Wolverine as an experiment. It offers a lot of options for crafting the "out of process" solution and can be done without Rabbit/ASB out of the gate.
Ivan Milosavljevic
@Vertygo
fail: Wolverine.Runtime.WolverineRuntime[0]
      Unexpected failure
      System.NotSupportedException: The CLR type Wolverine.Envelope isn't natively supported by Npgsql or your PostgreSQL. To use it with a PostgreSQL composite you need to specify DataTypeName or to map it, please refer to the documentation.
         at Npgsql.TypeMapping.TypeMapper.ResolveByClrType(Type type)
         at Npgsql.TypeMapping.TypeMapper.ResolveByClrType(Type type)
         at Npgsql.NpgsqlParameter.ResolveHandler(TypeMapper typeMapper)
         at Npgsql.NpgsqlParameterCollection.ProcessParameters(TypeMapper typeMapper, Boolean validateValues, CommandType commandType)
         at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken)
         at Weasel.Core.CommandExtensions.ExecuteOnce(DbCommand command, CancellationToken cancellation)
         at Weasel.Core.CommandExtensions.ExecuteOnce(DbCommand command, CancellationToken cancellation)
         at Wolverine.Persistence.Durability.DurableSendingAgent.<>c__DisplayClass14_0.<<enqueueForRetryAsync>b__4>d.MoveNext() in /home/runner/work/wolverine/wolverine/src/Wolverine/Persistence/Durability/DurableSendingAgent.cs:line 98
this is showing up when running persistance tests
Jeremy D. Miller
@jeremydmiller
Weird that didn’t show up in the tests
before I mean
Huh, okay. There were a lot of changes to the database structure just prior to 0.9.7. Somewhere I’m erroneously trying to stuff an Envelope directly in as a parameter
Jeremy D. Miller
@jeremydmiller
I’ll take that one
Ivan Milosavljevic
@Vertygo
👍
Jeremy D. Miller
@jeremydmiller
Hey folks, I’m making a benevolent dictator decision today that Wolverine will only support 7.0. I’ve gotten off track a little bit pushing for 1.0, but still expect that to happen hopefully within a month. @Vertygo just made a big PR that made several tests be more reliable, and that’s going to help
Oskar Dudycz
@oskardudycz
Good call :+1:
Ivan Milosavljevic
@Vertygo

There are quite few SQL Server tests that are failing due to this error:

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - Unknown error 1473249712)

This is due to OpenSSL security level 2 being enabled by default on Ubuntu 20.04 and later:
https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-encrypted-connections?view=sql-server-ver16#ubuntu-2004-and-other-recent-linux-distribution-releases

Jeremy D. Miller
@jeremydmiller
Good times. What do we have to do to get around that? We own the docker compose file here
Ivan Milosavljevic
@Vertygo
Not sure if certificate needs to be generated on the client or server side 🤷‍♂️
well, SQL Server Ubuntu server or GHA runner
Jeremy D. Miller
@jeremydmiller
Can we have that disabled from the docker setup? I'd like to not have to worry about certificates basically ever
Ivan Milosavljevic
@Vertygo
Was looking for that one too but couldn't find it
Jeremy D. Miller
@jeremydmiller
Set TrustServerCertificate to True if the client cannot connect to CA to validate the authenticity of the cert
maybe
?
Ivan Milosavljevic
@Vertygo
Tried, it still fails :(
Jeremy D. Miller
@jeremydmiller
Bummer. What do other people do? No way we're the only ones. For that matter, wanna see what this does? https://github.com/JasperFx/weasel/blob/master/.github/workflows/ci-build-mssql.yml
Ivan Milosavljevic
@Vertygo
interesting!
Jeremy D. Miller
@jeremydmiller
How did Babu do it? I've used it, but didn't dive in too much
Ivan Milosavljevic
@Vertygo
Wolverine has Encrypt=False in the connection string; maybe it needs to be set to True?
that is removed
Ivan Milosavljevic
@Vertygo
Weird, just copied one of the failing tests into the separate project with same setup (docker, Weasel etc) and it goes green 🤔
afmuller
@afmuller

Hi. I've been giving Wolverine a try. If I understand correctly, if the original sender requested a reply, the cascading message will be sent to the sender and not to any other handlers.

In the below example, the IssueCreated message will be returned to the caller and will not be processed by another other handlers.

app.MapPost("/issues/create", (CreateIssue body, IMessageBus bus) => bus.InvokeAsync<IssueCreated>(body))

As in the above example, is there a way to have the message be returned to the caller AND be processed by and registered handlers?
This would be useful for scenarios where the new issue id needs to be returned to the user while also allowing any background processes to react to the new issue.

Jeremy D. Miller
@jeremydmiller
@afmuller This has come up from someone else as well. To be honest, I never spent much time or thought on the “mediator” usage in Wolverine because I’ve never been a MediatR user or even thought to use that approach. Would you mind opening a GitHub issue for that? I think the end answer is probably that what you want to do is going to have to be made more explicit. I don’t think the cascading message ideal that works well in message handlers works as well for folks using Wolverine as a mediator tool
Matt Mercurio
@mattmercurio

Is there a slick way to observe Postgres inserts and bridge that on over to Wolverine? My scenario is using a Azure Logic App to capture a webhook, and then inject that directly to a table. (So it doesn't use a web api).

Also, I'm just using local queues for now. So not ASB or Rabbit. (I've solved this that way before)

Jeremy D. Miller
@jeremydmiller
What’s your persistence tooling? Or are you wanting to dig in at the postgresql level itself with CDC?
Matt Mercurio
@mattmercurio
CDC sounds like more than I want to get into. I imagined a simple trigger that would inject as a message into the local queue. I've done that quite a bit with NSB.
Jeremy D. Miller
@jeremydmiller
What would be initiating the message though? Easy from Marten, but what are you using for persistence?
Wojtek Suwala
@wojteksuwala
Hi, after reading an excellent post by Jeremy "Wolverine meets EF Core and Sql Server" I've tried to build a little demo project by reproducing steps in the article. It failed to save items in the database when called from minimal-api endpoint, which uses message bus. I cloned Wolverine repo and tried to debug the original sample. It seems that EFCorePersistenceFrameProvider::ApplyTransactionSupport never calls chain.Postprocessors.Add(MethodCall.For<MessageContext>(x => x.FlushOutgoingMessagesAsync())); which results in db context transaction not being committed. This call is guarded by if (chain.ShouldFlushOutgoingMessages()) which delegates to HandlerChain which always returns false. Any suggestions on how to fix this issue or at what components of Wolverine should I also look for transaction management?
Jeremy D. Miller
@jeremydmiller
@wojteksuwala Sorry for being slow. Looking at the code for EFCorePersistenceFrameProvider::ApplyTransactionSupport(), here's the relevant code:
        var dbType = DetermineDbContextType(chain, container);

        chain.Middleware.Insert(0, new EnrollDbContextInTransaction(dbType));


        var saveChangesAsync =
            dbType.GetMethod(nameof(DbContext.SaveChangesAsync), new[] { typeof(CancellationToken) });

        var call = new MethodCall(dbType, saveChangesAsync)
        {
            CommentText = "Added by EF Core Transaction Middleware"
        };

        chain.Postprocessors.Add(call);

        if (chain.ShouldFlushOutgoingMessages())
        {
#pragma warning disable CS4014
            chain.Postprocessors.Add(MethodCall.For<MessageContext>(x => x.FlushOutgoingMessagesAsync()));
#pragma warning restore CS4014
        }
The call to DbContext.SaveChangesAsync() is definitely there and gets applied regardless. The chain.ShouldFlushOutgoingMessages() is a vestigal organ leftover from the very early days of Jasper when it was going to be both a message bus and an alternative HTTP AI tool, so it should even matter here. The FlushOutgoingMessagesAsync() is called internally by Wolverine outside of the generated code.
So when you're saying that changes aren't happening like they're supposed to, could you preview the code with dotnet run -- codegen preview and see what code is geting spit out? There is actually an Alba test on that sample code, and it just passed on my box (like that means anything). I've had other reports of EF Core transaction middleware not working, but no reproductions. I've got nothing.
Jeremy D. Miller
@jeremydmiller
And nevermind, I'm seeing the wrong generated code
Jeremy D. Miller
@jeremydmiller
I'll try to jot down some notes later this evening in a new GitHub issue. You game to fix it? I'm a little perplexed about why the test is passing.
And the test is passing because I'm an idiot and wrote stupid code.
    [Fact]
    public async Task run_through_the_handler()
    {
        using var host = await AlbaHost.For<Program>();

        var name = Guid.NewGuid().ToString();
        var tracked = await host.InvokeMessageAndWaitAsync(new CreateItemCommand { Name = name });
        tracked.FindSingleTrackedMessageOfType<ItemCreated>()
            .ShouldNotBeNull();


        using var nested = host.Services.As<IContainer>().GetNestedContainer();
        var context = nested.GetInstance<ItemsDbContext>();

        var item = context.Items.FirstOrDefaultAsync(x => x.Name == name);
        item.ShouldNotBeNull();
    }
note the conspicuous lack of an await for the query to see if an Item was added with the right name
Wojtek Suwala
@wojteksuwala
The generated code looks ok, it calls SaveChangesAsync as it is supposed to do, but the transaction is started in RawDatabaseTransactionEnvelope::PersistIncomingAsync incoming message is saved, db context SaveChangesAsync is called ... but I cannot find a place where this transaction is committed. The only place where I can find CommitTransaction is in the DbContextOutbox::SaveChangesAndFlushMessagesAsync. But it is not called. In fact it is only called directly from sample controllers or tests.
Jeremy D. Miller
@jeremydmiller
Ah, okay. Are you looking at the ItemService sample btw? It should not be using the raw database transaction, that's the first problem.
44 replies
Sean Farrow
@SeanFarrow
I am new to wolverine and wondered whether it was possible to automatically commit events emitted from a handler to Martin without having to go and get the aggregate/stream manually? This assumes the stream ID is part of the event in the first place. I might have missed something in one of the samples though and if I have I apologise.
3 replies
alexzeitler
@alexzeitler:matrix.org
[m]
@jeremydmiller: Is the source code you're sharing in your Wolverine blog posts available somewhere?
Jeremy D. Miller
@jeremydmiller
Yes, but I've occasionally tweaked it here and there for specific blog posts: https://github.com/JasperFx/wolverine/tree/main/src/Samples/Middleware
alexzeitler
@alexzeitler:matrix.org
[m]
Thanks, will give it a try
pfx
@p-fx

Hi, I might need a hint about how to bind a single RabbitMQ queue with 2 topic-patterns to the a single topic exchange.
More or less the situation shown in the topics RabbitMQ tutorial https://www.rabbitmq.com/tutorials/tutorial-five-python.html

I'm experiencing that only a single binding - the first one - is being created.

The sample at https://wolverine.netlify.app/guide/messaging/transports/rabbitmq.html#snippet-sample_binding_topics_and_topic_patterns_to_queues shows the same behavior.
It can be reproduced by adding e.g. exchange.BindTopic("color.cyan").ToQueue("blue"); as shown below.

theSender = Host.CreateDefaultBuilder()
    .UseWolverine(opts =>
    {
        opts.UseRabbitMq().AutoProvision();
        opts.PublishAllMessages().ToRabbitTopics("wolverine.topics", exchange =>
        {
            exchange.BindTopic("color.green").ToQueue("green");
            exchange.BindTopic("color.blue").ToQueue("blue");
            exchange.BindTopic("color.cyan").ToQueue("blue"); // <<< This binding does not get created
            exchange.BindTopic("color.*").ToQueue("all");            
        });
    }).Start();

At first glance I was thinking whether below line of code might be involved
https://github.com/JasperFx/wolverine/blob/main/src/Transports/Wolverine.RabbitMQ/Internal/RabbitMqExchange.cs#L58