Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.Title = m_ThisName;
            Console.WriteLine("{0}.Main(): Entered. Awaiting your input to start the", m_ThisName);
            Console.WriteLine("  QueuedServicsBusHost for the Service Bus queue '{0}'\n  via WCF NetMessagingBinding.",
                              ConstsNEnums.IngestionQueueName);
            ConsoleNTraceHelpers.PauseTillUserPressesEnter();
            QueuedServiceBusHost host = null;

            try
            {
                host = new QueuedServiceBusHost(typeof(DataFeedsManager.DataFeedsManager));
                host.Open();
                Console.WriteLine("{0}.Main():  QueuedServiceBusHost opened OK.  Working.....", m_ThisName);
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0}.Main():  host.Open() Threw exception!\n     {1}", m_ThisName, ex.ToString());
            }

            Console.WriteLine("\n{0}.Main():  Press ENTER to EXIT.", m_ThisName);
            Console.ReadLine();
            if (host != null)
            {
                host.Close();
            }
            Console.WriteLine("\n{0}.Main(): Exiting......", m_ThisName);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // Get rid of compiler warnings by using the GenericResolver related variables.
            m_SbMessage        = new TestMessage();
            m_InProcessFeedMsg = new InProcessFeedMsg();

            Console.Title = m_ThisName;
            Console.WriteLine("{0}.Main(): Entered. Awaiting your input to start the", m_ThisName);
            Console.WriteLine("  QueuedServicsBusHost for the Service Bus queue '{0}'\n  via WCF NetMessagingBinding.",
                              ConstantsNEnums.IngestionQueueName);
            ConsoleNTraceHelpers.PauseTillUserPressesEnter();
            QueuedServiceBusHost queuedHost = null;

            try
            {
                Uri sbBaseAddr = new Uri("sb://AzExploreSbNS.servicebus.windows.net/");
                queuedHost = new QueuedServiceBusHost(typeof(DataFeedManager), false, sbBaseAddr);
                queuedHost.Open();
                Console.WriteLine("{0}.Main():  QueuedServiceBusHost opened OK.  Working.....", m_ThisName);
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0}.Main():  host.Open() Threw exception!\n     {1}", m_ThisName, ex);
            }

            Console.WriteLine("\n{0}.Main():  Press ENTER to EXIT.", m_ThisName);
            Console.ReadLine();
            CloseOrAbortHosts(queuedHost);
            Console.WriteLine("\n{0}.Main(): Exiting......", m_ThisName);
        }
        static void Main(string[] args)
        {
            // Get rid of compiler warnings by using the GenericResolver related variables.
            m_FeedStats          = new DataFeedStatistics();
            m_DataAnalysisResult = new IngestedDataAnalysisResult();

            Console.Title = m_ThisName;
            Console.WriteLine("{0}.Main(): Entered. Awaiting your input to start the", m_ThisName);
            Console.WriteLine("Service Host for the AdminManager and SomeManager");
            ConsoleNTraceHelpers.PauseTillUserPressesEnter();

            ServiceHost <AdminManager> adminHost       = null;
            ServiceHost <SomeManager>  someManagerHost = null;

            try
            {
                adminHost = new ServiceHost <AdminManager>();
                adminHost.Open();
                Console.WriteLine("{0}.Main():  Admin ServiceHost opened OK.", m_ThisName);

                someManagerHost = new ServiceHost <SomeManager>();
                someManagerHost.Open();
                Console.WriteLine("{0}.Main():  SomeManager ServiceHost opened OK.", m_ThisName);
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0}.Main():  host.Open() Threw exception!\n     {1}", m_ThisName, ex);
            }
            Console.WriteLine("\n{0}.Main():  Press ENTER to EXIT.", m_ThisName);
            Console.ReadLine();
            CloseOrAbortHosts(adminHost, someManagerHost);
            Console.WriteLine("\n{0}.Main(): Exiting......", m_ThisName);
        }