/// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            ConsumerApp app = new ConsumerApp();

            try
            {
                if ("HITS".Equals(SettingsManager.ConsumerSettings.ApplicationKey))
                {
                    app.RunSchoolInfoConsumer();
                    app.RunStaffPersonalConsumer();
                }
                else if ("Sif3DemoApp".Equals(SettingsManager.ConsumerSettings.ApplicationKey))
                {
                    app.RunStudentPersonalConsumer();
                }
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("Error running the " + SettingsManager.ConsumerSettings.ApplicationKey + "  Consumer.\n" + ExceptionUtils.InferErrorResponseMessage(e), e);
                }
            }

            Console.WriteLine("Press any key to continue ...");
            Console.ReadKey();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            ConsumerApp app = new ConsumerApp();

            try
            {
                if ("HITS".Equals(SettingsManager.ConsumerSettings.ApplicationKey))
                {
                    app.RunSchoolInfoConsumer();
                    app.RunStaffPersonalConsumer();
                }
                else if ("Sif3DemoApp".Equals(SettingsManager.ConsumerSettings.ApplicationKey))
                {
                    app.RunStudentPersonalConsumer();
                }

            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled) log.Error("Error running the " + SettingsManager.ConsumerSettings.ApplicationKey + "  Consumer.\n" + ExceptionUtils.InferErrorResponseMessage(e), e);
            }

            Console.WriteLine("Press any key to continue ...");
            Console.ReadKey();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            ConsumerApp app = new ConsumerApp();

            try
            {
                app.RunStudentPersonalConsumer();
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled) log.Error("Error running the StudentPersonal Consumer.\n" + ExceptionUtils.InferErrorResponseMessage(e), e);
            }

            Console.WriteLine("Press any key to continue ...");
            Console.ReadKey();
        }
Exemplo n.º 4
0
        private static void Main(string[] args)
        {
            ConsumerApp app = new ConsumerApp();

            try
            {
                app.RunStudentPersonalConsumer();
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("Error running the Student Personal CRUD Consumer.\n" + ExceptionUtils.InferErrorResponseMessage(e), e);
                }
            }

            Console.WriteLine("Press any key to continue ...");
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            ConsumerApp app = new ConsumerApp();

            if (RunDemo("Student Personal CRUD Consumer"))
            {
                try
                {
                    app.RunStudentPersonalConsumer();
                }
                catch (Exception e)
                {
                    if (log.IsErrorEnabled)
                    {
                        log.Error("Error running the Student Personal CRUD Consumer.\n" + ExceptionUtils.InferErrorResponseMessage(e), e);
                    }
                }
            }

            Console.WriteLine();
            Console.WriteLine("********************************************************************************");
            Console.WriteLine();
            Console.WriteLine("To run the following Event Consumer demo, the following is required:");
            Console.WriteLine();
            Console.WriteLine("  1) The consumer.environment.url app setting in the SifFramework.config file needs to reference the BROKERED environment endpoint.");
            Console.WriteLine("  2) The Sif.Framework.Demo.Broker needs to be run instead of the Sif.Framework.EnvironmentProvider.");
            Console.WriteLine();
            Console.WriteLine("********************************************************************************");

            if (RunDemo("Student Personal Event Consumer"))
            {
                try
                {
                    StudentPersonalEventConsumer studentPersonalConsumer = new StudentPersonalEventConsumer(
                        SettingsManager.ConsumerSettings.ApplicationKey,
                        SettingsManager.ConsumerSettings.InstanceId,
                        SettingsManager.ConsumerSettings.UserToken,
                        SettingsManager.ConsumerSettings.SolutionId);
                    studentPersonalConsumer.Start("Sif3DemoZone1", "DEFAULT");
                    if (log.IsInfoEnabled)
                    {
                        log.Info("Started the Event Consumer.");
                    }

                    Console.WriteLine("Press any key to stop the Event Consumer (may take several seconds to complete) ...");
                    Console.ReadKey();

                    studentPersonalConsumer.Stop();
                    if (log.IsInfoEnabled)
                    {
                        log.Info("Stopped the Event Consumer.");
                    }
                }
                catch (Exception e)
                {
                    if (log.IsErrorEnabled)
                    {
                        log.Error("Error running the Student Personal Event Consumer.\n" + ExceptionUtils.InferErrorResponseMessage(e), e);
                    }
                }
            }

            Console.WriteLine("Press any key to continue ...");
            Console.ReadKey();
        }