示例#1
0
 public QueryingDispatchMessage(string ldpOrderId, string ldpMerchanerId, string lvpOrderId, string lvpMerchanerId, int lotteryId, QueryingTypes queryingType) : base(ldpOrderId, ldpMerchanerId)
 {
     QueryingType   = queryingType;
     LvpOrderId     = lvpOrderId;
     LvpMerchanerId = lvpMerchanerId;
     LotteryId      = lotteryId;
 }
        private static string ToCommand(this QueryingTypes querying)
        {
            switch (querying)
            {
            case QueryingTypes.Awarding: return("103");

            case QueryingTypes.Ticketing: return("102");
            }
            throw new Exception();
        }
示例#3
0
        public Task PublishAsync(string ldpOrderId, string ldpMerchanerId, string lvpOrderId, string lvpMerchanerId, int lotteryId, QueryingTypes queryingType)
        {
            QueryingDispatchMessage queryingMessage = new QueryingDispatchMessage(ldpOrderId, ldpMerchanerId, lvpOrderId, lvpMerchanerId, lotteryId, queryingType);

            return(_busClient.PublishAsync(queryingMessage, context =>
            {
                context.UsePublishConfiguration(configuration =>
                {
                    configuration.OnDeclaredExchange(exchange =>
                    {
                        exchange.WithName("Baibaocp.LotteryDispatching")
                        .WithDurability(true)
                        .WithAutoDelete(false)
                        .WithType(ExchangeType.Topic);
                    });
                    configuration.WithRoutingKey($"LotteryDispatching.Querying.{ldpMerchanerId}");
                });
            }));
        }