Skip to content

Conversation

@sdesaiLULA
Copy link
Contributor

Provide the ability to send and receive wolverine envelope as cloud event for http transport. The earlier option was using binary serializer and not compatible with non dotnet systems. The cloud events structure gives readability and easy integration with other frameworks.

builder.Services.AddHttpClient(
    httpNamedClient,
    client =>
    {
        client.BaseAddress = new Uri("https://recepient");
        client.DefaultRequestHeaders.Add("Authorization", $"Bearer eyJ***");
    });

builder.UseWolverine(opts =>
{
    var transport = new HttpTransport();
    opts.Transports.Add(transport);
    // Publish all messages to the external http endpoint using the named http client
    // This will send a message in cloud event structure.
    opts.PublishAllMessages().ToHttpEndpoint(httpNamedClient, useCloudEvents: true, options: jsonOptions).SendInline();
    
    // If the httpendpoint supports native scheduled sends, use this, so Wolverine does't use in memory
    // opts.PublishAllMessages().ToHttpEndpoint(httpNamedClient, supportsNativeScheduledSend: true).SendInline();
});

// To handle single message over HTTP, send them to https://where-your-app-with-message-handlers/_wolverine/invoke
// with the content type `application/cloudevents+json`. The endpoint will convert cloud event to dotnet type and handle the message
// Register the WolverineHttpTransportClient for sending messages over HTTP
builder.Services.AddScoped<IWolverineHttpTransportClient, WolverineHttpTransportClientCloudEvents>();

@jeremydmiller
Copy link
Member

@sdesaiLULA Might need you to be a little more careful with your changes. The HTTP transport pull requests broke every single HTTP test. Can you try to run tests locally before you push?

@jeremydmiller jeremydmiller merged commit 28dd31a into JasperFx:main Jan 12, 2026
1 check passed
@sdesaiLULA sdesaiLULA deleted the support-cloud-events-http-transport branch January 13, 2026 01:57
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