public async Task SendAsync <TCommand>(TCommand command, ICustomMessageContext messageContext) { await this.busClient.PublishAsync(command, ctx => { ctx.UseMessageContext(messageContext).UseCustomRoutingKey(messageContext.TenantId, command.GetType()); ctx.UsePublishConfiguration(config => config.OnExchange("Some_exchange_name")); }); }
public void Handle(string message, ICustomMessageContext context) { Console.WriteLine("This is just me, handling a string..."); }