public void SetUp()
        {
            messageSender  = new FakeMessageSender();
            deferrer       = new FakeMessageDeferrer();
            ERROR_QUEUE    = new Address("error", "localhost");
            RETRIES_QUEUE  = new Address("retries", "localhost");
            ORIGINAL_QUEUE = new Address("org", "hostname");
            CLIENT_QUEUE   = Address.Parse("clientQ@myMachine");
            var busNotifications = new BusNotifications();

            satellite = new SecondLevelRetriesProcessor
            {
                FaultManager = new FaultManager(null, null, busNotifications)
                {
                    ErrorQueue = ERROR_QUEUE
                },
                MessageSender   = messageSender,
                MessageDeferrer = deferrer,
                InputAddress    = RETRIES_QUEUE,
                SecondLevelRetriesConfiguration = new SecondLevelRetriesConfiguration()
            };

            message = new TransportMessage(Guid.NewGuid().ToString(), new Dictionary <string, string> {
                { Headers.ReplyToAddress, CLIENT_QUEUE.ToString() }
            });
        }
Esempio n. 2
0
 public FirstLevelRetries(int maxRetries, IManageMessageFailures failureManager, CriticalError criticalError, BusNotifications busNotifications)
 {
     this.maxRetries = maxRetries;
     this.failureManager = failureManager;
     this.criticalError = criticalError;
     notifications = busNotifications;
 }
 public FirstLevelRetries(int maxRetries, IManageMessageFailures failureManager, CriticalError criticalError, BusNotifications busNotifications)
 {
     this.maxRetries     = maxRetries;
     this.failureManager = failureManager;
     this.criticalError  = criticalError;
     notifications       = busNotifications;
 }
Esempio n. 4
0
        /// <summary>
        ///     Create a new instance of <see cref="PipelineExecutor" />.
        /// </summary>
        /// <param name="settings">The settings to read data from.</param>
        /// <param name="builder">The builder.</param>
        /// <param name="busNotifications">Bus notifications.</param>
        public PipelineExecutor(ReadOnlySettings settings, IBuilder builder, BusNotifications busNotifications)
        {
            rootBuilder           = builder;
            this.busNotifications = busNotifications;

            var pipelineBuilder = new PipelineBuilder(settings.Get <PipelineModifications>());

            Incoming = pipelineBuilder.Incoming.AsReadOnly();
            Outgoing = pipelineBuilder.Outgoing.AsReadOnly();

            incomingBehaviors = Incoming.Select(r => r.BehaviorType);
            outgoingBehaviors = Outgoing.Select(r => r.BehaviorType);
        }
Esempio n. 5
0
            public Mutator(BusNotifications busNotifications)
            {
                ErrorsNotifications errors = busNotifications.Errors;

                errors.MessageSentToErrorQueue += (sender, retry) =>
                {
                    string headerText = HeaderWriter.ToFriendlyString <HeaderWriterError>(retry.Headers);
                    headerText = BehaviorCleaner.CleanStackTrace(headerText);
                    headerText = StackTraceCleaner.CleanStackTrace(headerText);
                    SnippetLogger.Write(text: headerText, suffix: "Error", version: "6");
                    ManualResetEvent.Set();
                };
            }
        void TransformEventToObservable()
        {
            BusNotifications busNotifications = new BusNotifications();

            #region ConvertEventToObservable

            IObservable <EventPattern <FailedMessage> > failedMessages = Observable.FromEventPattern <EventHandler <FailedMessage>, FailedMessage>(
                handler => busNotifications.Errors.MessageSentToErrorQueue += handler,
                handler => busNotifications.Errors.MessageSentToErrorQueue -= handler);

            IDisposable subscription = failedMessages
                                       .Subscribe(x => Console.WriteLine($"Message {x.EventArgs.MessageId} moved to error queue"));

            #endregion
        }
Esempio n. 7
0
        EventsToObservables(BusNotifications busNotifications, ILog log)
        {
            #region ConvertEventToObservable

            IObservable <EventPattern <FailedMessage> > failedMessages = Observable.FromEventPattern <EventHandler <FailedMessage>, FailedMessage>(
                handler => busNotifications.Errors.MessageSentToErrorQueue += handler,
                handler => busNotifications.Errors.MessageSentToErrorQueue -= handler);

            IDisposable subscription = failedMessages
                                       .Subscribe(x =>
            {
                FailedMessage failedMessage = x.EventArgs;
                log.Error($"Message {failedMessage.MessageId} moved to error queue", failedMessage.Exception);
            });

            #endregion
        }
        public void SetUp()
        {
            messageSender = new FakeMessageSender();
            deferrer = new FakeMessageDeferrer();
            ERROR_QUEUE = new Address("error", "localhost");
            RETRIES_QUEUE = new Address("retries", "localhost");
            ORIGINAL_QUEUE = new Address("org", "hostname");
            CLIENT_QUEUE = Address.Parse("clientQ@myMachine");
            var busNotifications = new BusNotifications();
            satellite = new SecondLevelRetriesProcessor
            {
                FaultManager = new FaultManager(null, null, busNotifications)
                {
                    ErrorQueue = ERROR_QUEUE
                },
                MessageSender = messageSender,
                MessageDeferrer = deferrer,
                InputAddress = RETRIES_QUEUE,
                SecondLevelRetriesConfiguration = new SecondLevelRetriesConfiguration()
            };

            message = new TransportMessage(Guid.NewGuid().ToString(), new Dictionary<string, string>{{Headers.ReplyToAddress,CLIENT_QUEUE.ToString()}});
        }
Esempio n. 9
0
 public GlobalErrorHandler(ILogger logger, BusNotifications busNotifications)
 {
     _logger           = logger;
     _busNotifications = busNotifications;
 }
Esempio n. 10
0
 public SubscribeToNotifications(BusNotifications busNotifications)
 {
     this.busNotifications = busNotifications;
 }
Esempio n. 11
0
 public FaultManager(ISendMessages sender, Configure config, BusNotifications busNotifications)
 {
     this.sender           = sender;
     this.config           = config;
     this.busNotifications = busNotifications;
 }
Esempio n. 12
0
 public FaultManager(ISendMessages sender, Configure config, BusNotifications busNotifications)
 {
     this.sender = sender;
     this.config = config;
     this.busNotifications = busNotifications;
 }
Esempio n. 13
0
 public ErrorsNotification(BusNotifications busNotifications)
 {
     this.busNotifications = busNotifications;
 }