Ejemplo n.º 1
0
        //ARCHIVE PIPELINE ACTIVITIES

        /**
         * CopyActivity from Blob source to Blob sink from ToBeProcessed Folder to Archived Folder
         */
        public Activity create_Activity_Archive_2(String toBeProcessedCompleteFolderDataset, String archiveFolderDataset, int i)
        {
            Console.WriteLine("Creating " + DualLoadConfig.ACTIVITY_ARCHIVE_2 + "_" + i);

            Activity activity = new Activity();

            List <ActivityInput> activityInputs = new List <ActivityInput>();
            ActivityInput        activityInput  = new ActivityInput();

            activityInput.Name = toBeProcessedCompleteFolderDataset;
            activityInputs.Add(activityInput);

            List <ActivityOutput> activityOutputs = new List <ActivityOutput>();
            ActivityOutput        activityOutput  = new ActivityOutput();

            activityOutput.Name = archiveFolderDataset + "_" + i;
            activityOutputs.Add(activityOutput);

            CopyActivity copyActivity = new CopyActivity();
            BlobSource   blobSource   = new BlobSource();

            copyActivity.Source = blobSource;
            //blobSource.Recursive = true;

            BlobSink sink = new BlobSink();

            sink.CopyBehavior = "PreserveHierarchy";

            //sink.WriteBatchSize = 10000;
            //sink.WriteBatchTimeout = TimeSpan.FromMinutes(10);
            copyActivity.Sink = sink;

            //Scheduler scheduler = new Scheduler();
            //scheduler.Frequency = SchedulePeriod.Hour;
            //scheduler.Interval = 1;


            activity.Name           = DualLoadConfig.ACTIVITY_ARCHIVE_2 + "_" + i;
            activity.Inputs         = activityInputs;
            activity.Outputs        = activityOutputs;
            activity.TypeProperties = copyActivity;
            //activity.Scheduler = scheduler;

            return(activity);
        }
Ejemplo n.º 2
0
        public void ConfigureDI(IWindsorContainer container)
        {
            var serviceLocator = new WindsorServiceLocator(container);

            container.Register(

                Component.For <Orchestrator>()
                .ImplementedBy <Orchestrator>()
                .LifestyleTransient(),

                Component.For <IActorConfiguration>()
                .Instance(
                    ActorDescriptors.FromAssemblyContaining <OrderAccepted>()
                    .ToConfiguration()),

                Component.For <IServiceLocator>()
                .Instance(serviceLocator),

                Component.For <IFactoryActor>()
                .ImplementedBy <FactoryActor>()
                .LifestyleTransient(),

                Component.For <IEventQueueOperator>()
                .ImplementedBy <ServiceBusOperator>()
                .DynamicParameters((k, dic)
                                   =>
            {
                dic["connectionString"] = _configurationValueProvider.GetValue("BusConnectionString");
            })
                .LifestyleSingleton(),

                Component.For(typeof(ICollectionStore <>))
                .ImplementedBy(typeof(AzureCollectionStore <>))
                .DynamicParameters((k, dic)
                                   =>
            {
                dic["connectionString"] = _configurationValueProvider.GetValue("StorageConnectionString");
            })
                .LifestyleSingleton(),

                Component.For(typeof(ICounterStore))
                .ImplementedBy(typeof(AzureCounterStore))
                .DynamicParameters((k, dic)
                                   =>
            {
                dic["source"] = new BlobSource()
                {
                    ConnectionString = _configurationValueProvider.GetValue("StorageConnectionString"),
                    ContainerName    = "locks",
                    Path             = "helloLocks/"
                };
            })
                .LifestyleSingleton(),

                Component.For(typeof(IKeyedListStore <>))
                .ImplementedBy(typeof(AzureKeyedListStore <>))
                .DynamicParameters((k, dic)
                                   =>
            {
                dic["connectionString"] = _configurationValueProvider.GetValue("StorageConnectionString");
            })
                .LifestyleSingleton(),

                Classes.FromAssemblyContaining <Order>()
                .Pick()
                );
        }