public static async Task DomainCommand(this IMessageSession ctx, ICommand command)
        {
            var options = new NServiceBus.SendOptions();

            options.RouteToThisEndpoint();
            options.SetHeader(Aggregates.Defaults.RequestResponse, "1");

            var response = await ctx.Request <IMessage>(command, options).ConfigureAwait(false);

            response.CommandResponse();
        }
Пример #2
0
 /// <summary>
 /// Route the message through the Gateway to the specified sites.
 /// </summary>
 public static void RouteToSites(this SendOptions options, params string[] siteKeys)
 {
     options.SetHeader(Headers.DestinationSites, string.Join(",", siteKeys));
     options.GetExtensions().Set(new RouteThroughGateway());
     options.RouteToThisEndpoint();
 }