public static MessageDetail Analyze(MessageDetail messageDetail)
 {
     // check the messageDetail and decide to retry or long retry
     // response with modified MessageDetail
     messageDetail.sendHistory.Add("checked");
     return(messageDetail);
 }
Exemple #2
0
        public void Process(MessageDetail messageDetail)
        {
            // write message based on template
            Console.WriteLine(mailType.GetMessageTemplate(messageDetail.content));
            // send message via provider
            MessageDetail respMessageDetail = messageSender.SendMessage(messageDetail.content);

            MessageDetailAnalyzer.Analyze(respMessageDetail);
        }
Exemple #3
0
 // This method can be exposed as a Rest Method
 public static bool enqueue(MessageDetail messageDetail)
 {
     try{
         sira.Enqueue(messageDetail);
         return(true);
     }catch (Exception ex) {
         Console.WriteLine(ex.Message);
         return(false);
     }
 }
Exemple #4
0
        public static void Main()
        {
            // Init or connect to mail request queue
            MailQueue.init();
            MessageDetail mailContent = MailQueue.peek();

            while (mailContent.status != 0)
            {
                MailProcessor processor = new MailProcessor(MailTypeSelector.getTypeForMail(mailContent.content), MailProviderSelector.getProviderForMail(mailContent.content));
                processor.Process(mailContent);
                mailContent = MailQueue.peek();
            }
            MailQueue.destroy();
            Console.WriteLine("DONE");
            Console.ReadKey();
        }