Skip to content

Conversation

@sdesaiLULA
Copy link
Contributor

This pull request introduces a new HTTP transport implementation and associated tests for the Wolverine framework. It adds a public HttpTransport class, a WolverineHttpTransportClient, and comprehensive test coverage for both. Additionally, a sample external HTTP server is provided to demonstrate usage. The main themes are the implementation of HTTP transport, testing, and sample usage.

HTTP Transport Implementation:

  • Introduced a public HttpTransport class that manages HTTP endpoints, caches them, and supports initialization and endpoint retrieval by URI. The transport now uses HTTPS as its protocol and is derived from TransportBase<HttpEndpoint>.
  • Added a public WolverineHttpTransportClient class that uses IHttpClientFactory to send single envelopes or batches of messages over HTTP, properly serializing content and setting content types.

Testing:

  • Added HttpTransportTests to ensure correct protocol usage, endpoint caching, retrieval, and initialization logic for the HTTP transport.
  • Added WolverineHttpTransportClientTests to verify correct HTTP requests are made for both single envelopes and batches, including a mock HTTP handler for inspection.

Sample Usage:

  • Added ExternalHttpServer.cs, a sample ASP.NET Core application showing how to configure Wolverine with HTTP transport, set up named HTTP clients, and define message handlers and endpoints.

@sdesaiLULA
Copy link
Contributor Author

We are looking at qstash as an alternative to our current Postgresql transport. We use Marten and wolverine, so I thought I'd enhance the existing http transport so we get all the benefits of wolverine and still use qstash.

@jeremydmiller
Copy link
Member

@sdesaiLULA oh, nice. This has been on my deep TODO list. The IHttpClientFactory usage will allow users to add security, right?

@sdesaiLULA
Copy link
Contributor Author

@jeremydmiller yes. The users can setup a http named client with any security scheme and pass it to httpTransport.

@jeremydmiller
Copy link
Member

@sdesaiLULA Bueno, turns out I need to push 5.9 for a client today, so this will get bundled in later today. This will actually get used in CritterWatch down the line.

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