Пример #1
0
        public InboxMessagePipeline(IServiceBusConfiguration configuration,
                                    GetWorkMessageObserver getWorkMessageObserver,
                                    DeserializeTransportMessageObserver deserializeTransportMessageObserver,
                                    DeferTransportMessageObserver deferTransportMessageObserver,
                                    DeserializeMessageObserver deserializeMessageObserver, DecryptMessageObserver decryptMessageObserver,
                                    DecompressMessageObserver decompressMessageObserver,
                                    AssessMessageHandlingObserver assessMessageHandlingObserver, IdempotenceObserver idempotenceObserver,
                                    HandleMessageObserver handleMessageObserver, TransactionScopeObserver transactionScopeObserver,
                                    AcknowledgeMessageObserver acknowledgeMessageObserver,
                                    SendDeferredObserver sendDeferredObserver, ReceiveExceptionObserver receiveExceptionObserver)
            : base(
                getWorkMessageObserver, deserializeTransportMessageObserver, deferTransportMessageObserver,
                deserializeMessageObserver, decryptMessageObserver, decompressMessageObserver,
                assessMessageHandlingObserver, idempotenceObserver, handleMessageObserver, transactionScopeObserver,
                acknowledgeMessageObserver, sendDeferredObserver, receiveExceptionObserver)
        {
            Guard.AgainstNull(configuration, nameof(configuration));

            State.SetWorkQueue(configuration.Inbox.WorkQueue);
            State.SetDeferredQueue(configuration.Inbox.DeferredQueue);
            State.SetErrorQueue(configuration.Inbox.ErrorQueue);

            State.SetDurationToIgnoreOnFailure(configuration.Inbox.DurationToIgnoreOnFailure);
            State.SetMaximumFailureCount(configuration.Inbox.MaximumFailureCount);
        }
Пример #2
0
        protected ReceiveMessagePipeline(GetWorkMessageObserver getWorkMessageObserver,
                                         DeserializeTransportMessageObserver deserializeTransportMessageObserver,
                                         DeferTransportMessageObserver deferTransportMessageObserver,
                                         DeserializeMessageObserver deserializeMessageObserver, DecryptMessageObserver decryptMessageObserver,
                                         DecompressMessageObserver decompressMessageObserver,
                                         AssessMessageHandlingObserver assessMessageHandlingObserver, IdempotenceObserver idempotenceObserver,
                                         HandleMessageObserver handleMessageObserver, TransactionScopeObserver transactionScopeObserver,
                                         AcknowledgeMessageObserver acknowledgeMessageObserver,
                                         SendDeferredObserver sendDeferredObserver, ReceiveExceptionObserver receiveExceptionObserver)
        {
            RegisterStage("Read")
            .WithEvent <OnGetMessage>()
            .WithEvent <OnAfterGetMessage>()
            .WithEvent <OnDeserializeTransportMessage>()
            .WithEvent <OnAfterDeserializeTransportMessage>()
            .WithEvent <OnDecompressMessage>()
            .WithEvent <OnAfterDecompressMessage>()
            .WithEvent <OnDecryptMessage>()
            .WithEvent <OnAfterDecryptMessage>()
            .WithEvent <OnDeserializeMessage>()
            .WithEvent <OnAfterDeserializeMessage>();

            RegisterStage("Handle")
            .WithEvent <OnStartTransactionScope>()
            .WithEvent <OnAssessMessageHandling>()
            .WithEvent <OnAfterAssessMessageHandling>()
            .WithEvent <OnProcessIdempotenceMessage>()
            .WithEvent <OnHandleMessage>()
            .WithEvent <OnAfterHandleMessage>()
            .WithEvent <OnCompleteTransactionScope>()
            .WithEvent <OnDisposeTransactionScope>()
            .WithEvent <OnSendDeferred>()
            .WithEvent <OnAfterSendDeferred>()
            .WithEvent <OnAcknowledgeMessage>()
            .WithEvent <OnAfterAcknowledgeMessage>();

            RegisterObserver(getWorkMessageObserver);
            RegisterObserver(deserializeTransportMessageObserver);
            RegisterObserver(deferTransportMessageObserver);
            RegisterObserver(deserializeMessageObserver);
            RegisterObserver(decryptMessageObserver);
            RegisterObserver(decompressMessageObserver);
            RegisterObserver(assessMessageHandlingObserver);
            RegisterObserver(idempotenceObserver);
            RegisterObserver(handleMessageObserver);
            RegisterObserver(transactionScopeObserver);
            RegisterObserver(acknowledgeMessageObserver);
            RegisterObserver(sendDeferredObserver);

            RegisterObserver(receiveExceptionObserver); // must be last
        }