private void PipelineCreated(object sender, PipelineEventArgs e)
        {
            var pipelineName = e.Pipeline.GetType().FullName ?? string.Empty;

            if (pipelineName.Equals(_startupPipelineName, StringComparison.InvariantCultureIgnoreCase))
            {
                e.Pipeline.RegisterObserver(this);

                return;
            }

            if (!pipelineName.Equals(_inboxMessagePipelineName, StringComparison.InvariantCultureIgnoreCase)
                &&
                !pipelineName.Equals(_dispatchTransportMessagePipelineName, StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            if (pipelineName.Equals(_inboxMessagePipelineName, StringComparison.InvariantCultureIgnoreCase))
            {
                e.Pipeline.GetStage("Handle")
                .BeforeEvent <OnHandleMessage>()
                .Register <OnBeforeHandleMessage>();
            }

            e.Pipeline.RegisterObserver(_sentinelObserver);
        }
Beispiel #2
0
        public async Task Invoke(Job job)
        {
            var args = new PipelineEventArgs(job, events, moduleCollection, HttpClient, RabbitChannel);
            var errorModuleExists = false;

            try
            {
                log.Debug("job received: {0}", job.Url);

                if (events.OnFireUrl == null)
                {
                    return;
                }
                if (args.Cancel)
                {
                    throw new ApplicationException(args.Response);
                }
                await events.OnFireUrl(args);
            }
            catch (Exception ex)
            {
                log.Error(ex.Message);
                if (events.OnErrorOccurred != null)
                {
                    errorModuleExists = true;
                }
            }

            if (errorModuleExists)
            {
                await events.OnErrorOccurred(args);
            }
        }
        private void PipelineCreated(object sender, PipelineEventArgs e)
        {
            if (!e.Pipeline.GetType().FullName.Equals(_startupPipelineName, StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            e.Pipeline.RegisterObserver(new PurgeQueuesObserver());
        }
Beispiel #4
0
        private void PipelineCreated(object sender, PipelineEventArgs e)
        {
            if (!e.Pipeline.GetType().FullName.Equals(_pipelineName, StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            e.Pipeline.RegisterObserver(_eventProcessingObserver);
        }
        private void PipelineCreated(object sender, PipelineEventArgs e)
        {
            if (e.Pipeline.GetType().FullName.Equals(_startupPipelineName, StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            e.Pipeline.RegisterObserver(new ActiveTimeRangeObserver(this, _activeTimeRange));
        }
        private void PipelineCreated(object sender, PipelineEventArgs e)
        {
            if (!e.Pipeline.GetType()
                .FullName.Equals(typeof(InboxMessagePipeline).FullName, StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            e.Pipeline.RegisterObserver(this);
        }
		private void PipelineCreated(object sender, PipelineEventArgs e)
		{
			if (!e.Pipeline.GetType().FullName.Equals(_startupPipelineName, StringComparison.InvariantCultureIgnoreCase))
			{
				return;
			}

			e.Pipeline.RegisterObserver(new ProcessConfigurationObserver(_databaseContextFactory, _eventStore, _keyStore,
				_configuration));
		}
Beispiel #8
0
        private void PipelineCreated(object sender, PipelineEventArgs e)
        {
            if (!(e.Pipeline.GetType().FullName ?? string.Empty)
                .Equals(_startupPipelineName, StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            e.Pipeline.RegisterObserver(_purgeInboxObserver);
        }
Beispiel #9
0
        private void PipelineCreated(object sender, PipelineEventArgs e)
        {
            if (!(e.Pipeline.GetType().FullName ?? string.Empty)
                .Equals(_inboxMessagePipelineName, StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            e.Pipeline.RegisterObserver(_messageForwardingObserver);
        }
        private void PipelineCreated(object sender, PipelineEventArgs e)
        {
            var pipelineName = e.Pipeline.GetType().FullName ?? string.Empty;

            if (pipelineName.Equals(_startupPipelineName, StringComparison.InvariantCultureIgnoreCase)
                ||
                pipelineName.Equals(_shutdownPipelineName, StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            e.Pipeline.RegisterObserver(new ActiveTimeRangeObserver(_activeTimeRange));
        }
        private void PipelineReleased(object sender, PipelineEventArgs e)
        {
            lock (padlock)
            {
                var assertion = GetAssertion(assertionName);

                if (assertion == null)
                {
                    return;
                }

                log.Information(string.Format("Invoking assertion for '{0}'.", assertion.Name));

                assertion.Action.Invoke();

                assertion.MarkAsRun();
            }
        }
Beispiel #12
0
        private async Task OnFireUrl(PipelineEventArgs e)
        {
            try
            {
                await utility.FireAsync(e.Job.Url, e.HttpClient);

                e.PipelineResponse = PipelineResponse.Continue;
                e.Transition       = Transition.Processed;
            }
            catch (Exception ex)
            {
                e.Cancel           = true;
                e.Response         = ex.Message;
                e.PipelineResponse = PipelineResponse.Error;

                throw new ApplicationException(ex.Message);
            }
        }
Beispiel #13
0
 public void OnPipelineReleased(object sender, PipelineEventArgs args)
 {
     PipelineReleased.Invoke(sender, args);
 }
		public void OnPipelineReleased(object sender, PipelineEventArgs args)
		{
            PipelineReleased.Invoke(sender, args);
		}