Introduction to Convey.
Convey is a set of helper libraries that can be most of the time (with some exceptions) used independently of each other to help you to build your web applications and microservices. Convey is neither a framework nor a silver bullet.
Quite opposite, it’s mostly the set of extensions methods along with additional abstractions that will help you to deal with common infrastructural concerns such as routing, service discovery, load balancing, tracing, asynchronous messaging and so on.
In order to find out how you can use Convey in a real-world scenarios, take a look at the sample projects available on our DevMentors.io GitHub organization. There are 4 projects for now:
And if you’re looking for the resources about building microservices with .NET Core, check out our premium course Microservices .NET or a free one available on YouTube (almost 20 hours) titled Distributed .NET Core.
Feel free to take a look at our other projects that you might find useful when building the distributed services:
In order to get started with Convey, simply install the core package:
dotnet add package Convey
Its sole responsibility is to expose IConveyBuilder
being used by other packages, which provides fluent API experience, similar to built-in ASP.NET Core IServiceCollection
and IApplicationBuilder
abstractions.
public class Program
{
public static async Task Main(string[] args)
=> await WebHost.CreateDefaultBuilder(args)
.ConfigureServices(services => services.AddConvey().Build())
.Configure(app =>
{
//Configure the middleware
})
.Build()
.RunAsync();
}
Whether you’re using just a Program.cs
on its own (yes, you can build your web applications and microservices without a need of having Startup
class and AddMvc()
along with full UseMvc()
middleware) or doing it with a Startup.cs
included, just invoke AddConvey()
on IServiceCollection
instance within the ConfigureServices()
method and start using Convey packages.
The core Convey package also registers AppOptions
type which contains the application name (and it’s purely optional).
name
- an optional name of the application.displayBanner
- display a banner (console output) with the application name during a startup, true
by default."app": {
"name": "some service",
"displayBanner": true
}