コード例 #1
0
 public RebusResourceNotifier(IRebusResourceNotifier_Config config)
 {
     _providerName = config.ProviderName;
     _configurer   = Configure.With(new SimpleInjectorContainerAdapter(_container))
                     .Logging(l => l.NLog())
                     .Transport(t => t.UseAzureServiceBusAsOneWayClient(config.AsbConnectionString))
                     .Options(o =>
     {
         o.EnableCompression();
         o.SetMaxParallelism(1);
         o.SetNumberOfWorkers(1);
     })
                     .Serialization(s =>
     {
         var cfg = new JsonSerializerSettings();
         cfg     = cfg.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
         cfg.TypeNameHandling       = TypeNameHandling.None;
         cfg.ObjectCreationHandling = ObjectCreationHandling.Replace;
         s.UseNewtonsoftJson(cfg);
     })
     ;
     if (config.StartAtCreation)
     {
         Start();
     }
 }
コード例 #2
0
 public RebusResourceNotifier(IRebusResourceNotifier_Config config)
 {
     _providerName = config.ProviderName;
     _container.ConfigureRebus(c => c
                               .Logging(l => l.NLog())
                               .Transport(t => t.UseAzureServiceBusAsOneWayClient(config.AsbConnectionString).UseLegacyNaming())
                               .Options(o =>
     {
         o.EnableCompression();
         o.SetMaxParallelism(1);
         o.SetNumberOfWorkers(1);
         o.SimpleRetryStrategy(maxDeliveryAttempts: ResourceConstants.MaxRetryCount);
     })
                               .Serialization(s =>
     {
         var cfg = new JsonSerializerSettings();
         cfg     = cfg.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
         cfg.TypeNameHandling       = TypeNameHandling.None;
         cfg.ObjectCreationHandling = ObjectCreationHandling.Replace;
         s.UseNewtonsoftJson(cfg);
     })
                               );
     if (config.StartAtCreation)
     {
         Start();
     }
 }
コード例 #3
0
ファイル: Test_Host.cs プロジェクト: ARKlab/Ark.Tools
            public Host WithNotifier(IRebusResourceNotifier_Config rebusCfg)
            {
                this.AppendFileProcessor <TestWriter_Notifier>(deps =>
                {
                    deps.Container.RegisterInstance(rebusCfg);
                    deps.Container.RegisterSingleton <RebusResourceNotifier>();
                });

                //_logger.Info("Rebus notifier added to host");

                return(this);
            }