Esempio n. 1
0
        void IIngestedRepos.SaveTestData(InProcessFeedMsg msg)
        {
            TestDataEntity msgEntity  = null;
            string         moreExInfo = string.Empty;

            try
            {
                msgEntity = MakeTestDataEntity(msg);

                // TODO 5-23-15 Failsafe requires using Transient Fault application block and
                // maybe circuit breaker pattern on all requests for cloud services.  Wrap below
                // code in that stuff as an example.
                AzureStorageHelpers.AzTableStorageInsert(ConstantsNEnums.TestMessageTableName, msgEntity);
            }
            catch (StorageException ex)
            {
                if (ex.Message.Contains("409"))
                {
                    moreExInfo = "\n HTTP 409 error code: RowKey already exists in table on insert.";
                }
                string displayMsg = string.Format("\n{0}.SaveTestData():", m_ThisName);
                ConsoleNTraceHelpers.DisplayExToConsoleNTrace(displayMsg, ex);
                ConsoleNTraceHelpers.DisplayInfoToConsoleNTrace(moreExInfo);
                throw;
            }
            catch (Exception ex)
            {
                string displayMsg = string.Format("\n{0}.SaveTestData():", m_ThisName);
                ConsoleNTraceHelpers.DisplayExToConsoleNTrace(displayMsg, ex);
                throw;
            }
        }
 void IAdminValidityEngine.IsPresentFeedComponentInfoRequestValid(string componentName)
 {
     // In a real app one would likely have the FeedAdminDA check to see if the componentName
     // was an active Feed Component in the system and throw an exception if not.
     // That's too much work for a demo.  This suffices to show the concept and test it.
     if (string.IsNullOrEmpty(componentName))
     {
         ConsoleNTraceHelpers.DisplayInfoToConsoleNTrace(m_ThisName + ".IAdminValidityEngine.IsPresentFeedComponentInfoRequestValid():  arg was null or empty.");
         throw new ArgumentNullException("componentName", "IAdminValidityEngine -- String was null or empty.");
     }
 }
Esempio n. 3
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);
        }
        DataFeedStatistics IFeedAdmin.PresentFeedComponentInfo(string componentName)
        {
            ConsoleNTraceHelpers.DisplayInfoToConsoleNTrace(m_ThisName + ".PresentFeedComponentInfo(): Entered:");

            // Check validity of all requests.
            IAdminValidityEngine validityEngProxy = InProcFactory.CreateInstance <ValidityEngine, IAdminValidityEngine>();

            validityEngProxy.IsPresentFeedComponentInfoRequestValid(componentName);
            InProcFactory.CloseProxy(validityEngProxy);

            // Retrieve Feed Component info
            DataFeedStatistics stats            = null;
            IFeedAdminDA       feedAdminDaProxy = InProcFactory.CreateInstance <AdminDA, IFeedAdminDA>();

            stats = feedAdminDaProxy.GetFeedStatistics(componentName);
            InProcFactory.CloseProxy(feedAdminDaProxy);

            return(stats);
        }