コード例 #1
0
        public static IMayWantOptionalSettings InRegions(this JustSayingFluentlyDependencies dependencies, IEnumerable <string> regions)
        {
            var config = new MessagingConfig();

            if (dependencies.MessageSubjectProvider != null)
            {
                config.MessageSubjectProvider = dependencies.MessageSubjectProvider;
            }

            if (regions != null)
            {
                foreach (var region in regions)
                {
                    config.Regions.Add(region);
                }
            }

            config.Validate();

            var messageSerializationRegister = new MessageSerializationRegister(config.MessageSubjectProvider);
            var justSayingBus = new JustSayingBus(config, messageSerializationRegister, dependencies.LoggerFactory);

            var awsClientFactoryProxy = new AwsClientFactoryProxy(() => CreateMeABus.DefaultClientFactory());

            var amazonQueueCreator = new AmazonQueueCreator(awsClientFactoryProxy, dependencies.LoggerFactory);
            var bus = new JustSayingFluently(justSayingBus, amazonQueueCreator, awsClientFactoryProxy, dependencies.LoggerFactory);

            bus
            .WithMonitoring(new NullOpMessageMonitor())
            .WithSerializationFactory(new NewtonsoftSerializationFactory());

            return(bus);
        }
コード例 #2
0
        public static IMayWantOptionalSettings InRegions(params string[] regions)
        {
            var config = new MessagingConfig();

            if (regions != null)
            {
                foreach (var region in regions)
                {
                    config.Regions.Add(region);
                }
            }

            config.Validate();

            var messageSerialisationRegister = new MessageSerialisationRegister();
            var justSayingBus = new JustSayingBus(config, messageSerialisationRegister);

            var amazonQueueCreator = new AmazonQueueCreator();
            var bus = new JustSayingFluently(justSayingBus, amazonQueueCreator);

            bus
            .WithMonitoring(new NullOpMessageMonitor())
            .WithSerialisationFactory(new NewtonsoftSerialisationFactory());

            return(bus);
        }
コード例 #3
0
        public static IMayWantOptionalSettings InRegions(params string[] regions)
        {
            var config = new MessagingConfig();
            
            if (regions != null)
            foreach (var region in regions)
            {
                config.Regions.Add(region);
            }

            config.Validate();

            var messageSerialisationRegister = new MessageSerialisationRegister();
            var justSayingBus = new JustSayingBus(config, messageSerialisationRegister);

            var awsClientFactoryProxy = new AwsClientFactoryProxy(() => DefaultClientFactory());
                
            var amazonQueueCreator = new AmazonQueueCreator(awsClientFactoryProxy);
            var bus = new JustSayingFluently(justSayingBus, amazonQueueCreator, awsClientFactoryProxy);

            bus
                .WithMonitoring(new NullOpMessageMonitor())
                .WithSerialisationFactory(new NewtonsoftSerialisationFactory());

            return bus;
        }
コード例 #4
0
ファイル: CreateMe.cs プロジェクト: jaimalchohan/JustSaying
        public static IMayWantOptionalSettings InRegion(string region)
        {
            var config = new MessagingConfig {Region = region};

            config.Validate();

            var bus = new JustSayingFluently(new JustSayingBus(config, new MessageSerialisationRegister()), new AmazonQueueCreator());
            bus.WithMonitoring(new NullOpMessageMonitor());
            bus.WithSerialisationFactory(new NewtonsoftSerialisationFactory());

            return bus;
        }
コード例 #5
0
        public static IMayWantOptionalSettings InRegion(string region)
        {
            var config = new MessagingConfig {
                Region = region
            };

            config.Validate();

            var bus = new JustSayingFluently(new JustSayingBus(config, new MessageSerialisationRegister()), new AmazonQueueCreator());

            bus.WithMonitoring(new NullOpMessageMonitor());
            bus.WithSerialisationFactory(new NewtonsoftSerialisationFactory());

            return(bus);
        }