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);
        }
Example #2
0
        public OutboxPipeline(IServiceBusConfiguration configuration, GetWorkMessageObserver getWorkMessageObserver,
                              DeserializeTransportMessageObserver deserializeTransportMessageObserver,
                              SendOutboxMessageObserver sendOutboxMessageObserver, AcknowledgeMessageObserver acknowledgeMessageObserver,
                              OutboxExceptionObserver outboxExceptionObserver)
        {
            Guard.AgainstNull(configuration, nameof(configuration));

            State.SetWorkQueue(configuration.Outbox.WorkQueue);
            State.SetErrorQueue(configuration.Outbox.ErrorQueue);

            State.SetDurationToIgnoreOnFailure(configuration.Outbox.DurationToIgnoreOnFailure);
            State.SetMaximumFailureCount(configuration.Outbox.MaximumFailureCount);

            RegisterStage("Read")
            .WithEvent <OnGetMessage>()
            .WithEvent <OnAfterGetMessage>()
            .WithEvent <OnDeserializeTransportMessage>()
            .WithEvent <OnAfterDeserializeTransportMessage>();

            RegisterStage("Send")
            .WithEvent <OnDispatchTransportMessage>()
            .WithEvent <OnAfterDispatchTransportMessage>()
            .WithEvent <OnAcknowledgeMessage>()
            .WithEvent <OnAfterAcknowledgeMessage>();

            RegisterObserver(getWorkMessageObserver);
            RegisterObserver(deserializeTransportMessageObserver);
            RegisterObserver(sendOutboxMessageObserver);

            RegisterObserver(acknowledgeMessageObserver);

            RegisterObserver(outboxExceptionObserver); // must be last
        }
Example #3
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
        }
        public DistributorPipeline(IServiceBusConfiguration configuration,
                                   GetWorkMessageObserver getWorkMessageObserver,
                                   DeserializeTransportMessageObserver deserializeTransportMessageObserver,
                                   DistributorMessageObserver distributorMessageObserver,
                                   SerializeTransportMessageObserver serializeTransportMessageObserver,
                                   DispatchTransportMessageObserver dispatchTransportMessageObserver,
                                   AcknowledgeMessageObserver acknowledgeMessageObserver,
                                   DistributorExceptionObserver distributorExceptionObserver)
        {
            Guard.AgainstNull(configuration, nameof(configuration));

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

            RegisterStage("Distribute")
            .WithEvent <OnGetMessage>()
            .WithEvent <OnDeserializeTransportMessage>()
            .WithEvent <OnAfterDeserializeTransportMessage>()
            .WithEvent <OnHandleDistributeMessage>()
            .WithEvent <OnAfterHandleDistributeMessage>()
            .WithEvent <OnSerializeTransportMessage>()
            .WithEvent <OnAfterSerializeTransportMessage>()
            .WithEvent <OnDispatchTransportMessage>()
            .WithEvent <OnAfterDispatchTransportMessage>()
            .WithEvent <OnAcknowledgeMessage>()
            .WithEvent <OnAfterAcknowledgeMessage>();

            RegisterObserver(getWorkMessageObserver);
            RegisterObserver(deserializeTransportMessageObserver);
            RegisterObserver(distributorMessageObserver);
            RegisterObserver(serializeTransportMessageObserver);
            RegisterObserver(dispatchTransportMessageObserver);
            RegisterObserver(acknowledgeMessageObserver);

            RegisterObserver(distributorExceptionObserver); // must be last
        }