Exemple #1
0
        public override void InitialiseBus()
        {
            var busConfig = new RawRabbitConfiguration
            {
                Username               = "******",
                Password               = "******",
                Port                   = 5672,
                VirtualHost            = "/",
                PersistentDeliveryMode = true,
                Hostnames              = { ConnectionString },
            };

            _busClient = BusClientFactory.CreateDefault(busConfig);
        }
Exemple #2
0
 public static IBusClient <MessageContext> getExtendableClient()
 {
     if (_extbusClient == null)
     {
         lock (_locker)
         {
             if (_extbusClient == null)
             {
                 _extbusClient = RawRabbit.vNext.BusClientFactory.CreateDefault <MessageContext>(cfg =>
                 {
                     cfg.SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("rawrabbit.json", optional: true, reloadOnChange: true);
                 },
                                                                                                 conf =>
                 {
                     conf.AddSingleton <ILoggerFactory, LoggerFactory>().AddSingleton <IConfigurationEvaluator, AttributeConfigEvaluator>().AddSingleton(c => Conventions);
                 });
             }
         }
     }
     return(_extbusClient);
 }
 public MessageHandlerExceptionTests()
 {
     _errorHandler = new Mock <IErrorHandlingStrategy>();
     _client       = TestClientFactory.CreateNormal(ioc => ioc.AddSingleton(c => _errorHandler.Object));
 }
Exemple #4
0
 public void Dispose()
 {
     _busClient    = null;
     _extbusClient = null;
 }
		public MessageHandlerExceptionTests()
		{
			_errorHandler = new Mock<IErrorHandlingStrategy>();
			_client = TestClientFactory.CreateNormal(ioc => ioc.AddSingleton(c => _errorHandler.Object));
		}
Exemple #6
0
 private static void RegisterDependencies(RawRabbit.vNext.Disposable.IBusClient <AdvancedMessageContext> client, IServiceCollection service)
 {
     service.AddSingleton(client);
     service.AddTransient <TestSubscribeWorker>();
 }