Exemplo n.º 1
0
 public static IBusControl InMemory(EndpointConfiguration[] endpointConfigs)
 {
     return Bus.Factory.CreateUsingInMemory(cfg =>
     {
         foreach (var config in endpointConfigs)
         {
             cfg.ReceiveEndpoint(config.QueueName, ecfg =>
             {
                 config.Configuration(ecfg);
             });
         }
     });
 }
Exemplo n.º 2
0
        public static IBusControl ForRabbitMq(EndpointConfiguration[] endpointConfigs)
        {
            return Bus.Factory.CreateUsingRabbitMq(cfg =>
            {
                var host = cfg.Host(GetHostAddress(), h =>
                {
                    h.Username(ConfigurationManager.AppSettings["RabbitMQUsername"]);
                    h.Password(ConfigurationManager.AppSettings["RabbitMQPassword"]);
                });

                foreach (var config in endpointConfigs)
                {
                    cfg.ReceiveEndpoint(host, config.QueueName, ecfg =>
                    {
                        config.Configuration(ecfg);
                    });
                }
            });
        }