Dispatching Requests
Usage
public class Program
{
private static void Main()
{
var host = Host.CreateDefaultBuilder()
.ConfigureServices((context, collection) =>
{
collection.AddBrighter().AutoFromAssemblies();
})
.UseConsoleLifetime()
.Build();
var commandProcessor = host.Services.GetService<IAmACommandProcessor>();
commandProcessor.Send(new GreetingCommand("Ian"));
host.WaitForShutdown();
}
}Registering a Handler
Taking a Dependency on a Command Processor
Producers
Consumer
Pipelines Must be Homogeneous
Setting Request Context Explicitly
Example: Setting Partition Key and Headers
Example: Publishing Events with CloudEvents Extensions
Example: Transactional Messaging with Context
Dispatching Requests
Internal Bus: Send & Publish
Internal Bus: Sending a Command
Internal Bus: Returning results of a Command to the caller.
Internal Bus: Publishing an Event
External Bus: Post, Deposit and Clear
Message Mapper, MT_COMMAND and MT_EVENT
Last updated
Was this helpful?
