Beispiel #1
0
        public async Task <List <RealtimeTriggered> > Process()
        {
            var items = new List <RealtimeTriggered>();

            RealtimeTriggered e = new RealtimeTriggered(Guid.NewGuid());

            e.Flow     = "CardsFlow";
            e.Customer = "KLA0000";
            e.Folder   = @"C:\Temp\Omnia\Realtime";
            e.Filter   = "*.zip";
            items.Add(e);

            return(items);
        }
Beispiel #2
0
        private async Task HandleAsync(RealtimeTriggered realtimetriggered)
        {
            //ophalen alles bestanden die voldoen aan de trigger
            //bestanden verplaatsten naar inprocess map (in mapje met id).
            //dan de volgende queue aanroepen voor de echte verwerking
            var files = Directory.GetFiles(realtimetriggered.Folder, realtimetriggered.Filter);

            foreach (var file in files)
            {
                //kijken of file gelocked is, zo ja dan overslaan
                File.Move(file, Path.Combine(Path.GetDirectoryName(file), "InProcess", Path.GetFileName(file)));
                FileDelivered e = new FileDelivered(realtimetriggered.MessageId, Guid.NewGuid(), Path.Combine(Path.GetDirectoryName(file), "InProcess", Path.GetFileName(file)), realtimetriggered.Flow, realtimetriggered.Customer);
                await _messagePublisher.PublishMessageAsync(e.MessageType, e, "");
            }
            //await Task.Delay(2000);
        }