Пример #1
0
        void IDataFeeds.IngestTestData(TestMessage msg)
        {
            string greeting = String.Format("\n{0}.IngestTestData(): Entered.", m_ThisName);

            Console.WriteLine(greeting);
            Trace.TraceInformation("**" + greeting);
            ConsoleNTraceHelpers.DisplayTestMessage(msg);
            ConsoleNTraceHelpers.TraceTestMessage(msg);

            // Below is where the code goes that does the work of this service operation.
            // That code will be developed in subsequent iterations.
        }
Пример #2
0
        private static void DisplayMsgAndQueueLength(TestMessage msg, InProcessFeedMsg checkedMsg)
        {
            // For test client only.
            IFeedAdminDA feedAdminDaProxy = InProcFactory.CreateInstance <AdminDA, IFeedAdminDA>();
            long         queueLength      = feedAdminDaProxy.GetQueueLength(iFX.Common.ConstantsNEnums.IngestionQueueName);

            InProcFactory.CloseProxy(feedAdminDaProxy);
            checkedMsg.QueueLength = queueLength;
            string queueLengthMsg = string.Format("{0} count = {1}",
                                                  iFX.Common.ConstantsNEnums.IngestionQueueName,
                                                  queueLength);

            ConsoleNTraceHelpers.DisplayInfoToConsoleNTrace(queueLengthMsg);
            ConsoleNTraceHelpers.DisplayTestMessage(msg);
            ConsoleNTraceHelpers.TraceTestMessage(msg);
        }
        private static void IngestTestData(TestMessage msg, string queueName)
        {
            // "Programming WCF Services" 3rd edition by Juval Lowy pp 259-260 recommends the
            // following form when needing to catch exceptions near the SendQueuedTestMessage().
            DataFeedsClient proxy = new DataFeedsClient(queueName);

            try
            {
                proxy.IngestTestData(msg);
                proxy.Close();
                Console.WriteLine("{0}.IngestTestData(): Test message enqueued Ok.", m_ThisName);
                ConsoleNTraceHelpers.DisplayTestMessage(msg);
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0}.IngestTestData(): Proxy threw exception\n {1}.", m_ThisName, ex);
                proxy.Abort();
            }
        }
Пример #4
0
        private static void IngestTestData(TestMessage msg, string queueName)
        {
            // Allow calculation of elapsed time: From proxy instantiation
            // till the message is received by the instantiated service instance.
            msg.MessageSendDateTime = DateTime.Now;

            // "Programming WCF Services" 3rd edition by Juval Lowy pp 259-260 recommends the
            // following form when needing to catch exceptions near the SendQueuedTestMessage().
            DataFeedsClient proxy = new DataFeedsClient(queueName);

            try
            {
                proxy.IngestTestData(msg);
                proxy.Close();
                Console.WriteLine("{0}.IngestTestData(): Test message enqueued Ok.", m_ThisName);
                ConsoleNTraceHelpers.DisplayTestMessage(msg);
            }
            catch (Exception ex)
            {
                ConsoleNTraceHelpers.DisplayExToConsoleNTrace(m_ThisName + ".IngestTestData(): ", ex);
                proxy.Abort();
            }
        }