Exemple #1
0
        public DistributorPipeline(IServiceBusConfiguration configuration, GetWorkMessageObserver getWorkMessageObserver, DeserializeTransportMessageObserver deserializeTransportMessageObserver,
                                   DistributorMessageObserver distributorMessageObserver, SerializeTransportMessageObserver serializeTransportMessageObserver,
                                   DispatchTransportMessageObserver dispatchTransportMessageObserver, AcknowledgeMessageObserver acknowledgeMessageObserver,
                                   DistributorExceptionObserver distributorExceptionObserver)
        {
            Guard.AgainstNull(configuration, "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
        }
Exemple #2
0
        public DispatchTransportMessagePipeline(FindMessageRouteObserver findMessageRouteObserver, SerializeTransportMessageObserver serializeTransportMessageObserver,
                                                DispatchTransportMessageObserver dispatchTransportMessageObserver)
        {
            RegisterStage("Send")
            .WithEvent <OnFindRouteForMessage>()
            .WithEvent <OnAfterFindRouteForMessage>()
            .WithEvent <OnSerializeTransportMessage>()
            .WithEvent <OnAfterSerializeTransportMessage>()
            .WithEvent <OnDispatchTransportMessage>()
            .WithEvent <OnAfterDispatchTransportMessage>();

            RegisterObserver(findMessageRouteObserver);
            RegisterObserver(serializeTransportMessageObserver);
            RegisterObserver(dispatchTransportMessageObserver);
        }