コード例 #1
0
 protected override void DoSetUp()
 {
     activateHandlers = new HandlerActivatorForTesting();
     determineDestination = Mock<IDetermineDestination>();
     sendMessages = Mock<ISendMessages>();
     serializeMessages = new JsonMessageSerializer();
     storeSagaData = Mock<IStoreSagaData>();
     receiveMessages = new MessageReceiverForTesting(serializeMessages);
     inspectHandlerPipeline = new TrivialPipelineInspector();
     storeSubscriptions = Mock<IStoreSubscriptions>();
     bus = CreateTheBus();
     bus.Start();
 }
コード例 #2
0
 protected override void DoSetUp()
 {
     activateHandlers       = new HandlerActivatorForTesting();
     determineDestination   = Mock <IDetermineDestination>();
     sendMessages           = Mock <ISendMessages>();
     serializeMessages      = new JsonMessageSerializer();
     storeSagaData          = Mock <IStoreSagaData>();
     receiveMessages        = new MessageReceiverForTesting(serializeMessages);
     inspectHandlerPipeline = new TrivialPipelineInspector();
     storeSubscriptions     = Mock <IStoreSubscriptions>();
     bus = CreateTheBus();
     bus.Start();
 }
コード例 #3
0
        /// <summary>
        /// Constructs the bus with the specified ways of achieving its goals.
        /// </summary>
        /// <param name="activateHandlers">The bus will use this to construct handlers for received messages.</param>
        /// <param name="sendMessages">Will be used to send transport messages when you send, publish, and reply.</param>
        /// <param name="receiveMessages">Will be used to receive transport messages. If the bus is configured to run with multiple threads, this one should be reentrant.</param>
        /// <param name="storeSubscriptions">Will be used to store subscription information. Is only relevant if the bus is a publisher, i.e. it publishes messages and other services assume they can subscribe to its messages.</param>
        /// <param name="storeSagaData">Will be used to store saga data. Is only relevant if one or more handlers are derived from <see cref="Saga"/>.</param>
        /// <param name="determineDestination">Will be used to resolve a destination in cases where the message destination is not explicitly specified as part of a send/subscribe operation.</param>
        /// <param name="serializeMessages">Will be used to serialize and deserialize transport messages.</param>
        /// <param name="inspectHandlerPipeline">Will be called to inspect the pipeline of handlers constructed to handle an incoming message.</param>
        public RebusBus(IActivateHandlers activateHandlers, ISendMessages sendMessages, IReceiveMessages receiveMessages, IStoreSubscriptions storeSubscriptions, IStoreSagaData storeSagaData, IDetermineDestination determineDestination, ISerializeMessages serializeMessages, IInspectHandlerPipeline inspectHandlerPipeline)
        {
            this.activateHandlers       = activateHandlers;
            this.sendMessages           = sendMessages;
            this.receiveMessages        = receiveMessages;
            this.storeSubscriptions     = storeSubscriptions;
            this.determineDestination   = determineDestination;
            this.serializeMessages      = serializeMessages;
            this.storeSagaData          = storeSagaData;
            this.inspectHandlerPipeline = inspectHandlerPipeline;

            rebusId = Interlocked.Increment(ref rebusIdCounter);

            log.Info("Rebus bus created");
        }
コード例 #4
0
        /// <summary>
        /// Constructs the bus with the specified ways of achieving its goals.
        /// </summary>
        /// <param name="activateHandlers">The bus will use this to construct handlers for received messages.</param>
        /// <param name="sendMessages">Will be used to send transport messages when you send, publish, and reply.</param>
        /// <param name="receiveMessages">Will be used to receive transport messages. If the bus is configured to run with multiple threads, this one should be reentrant.</param>
        /// <param name="storeSubscriptions">Will be used to store subscription information. Is only relevant if the bus is a publisher, i.e. it publishes messages and other services assume they can subscribe to its messages.</param>
        /// <param name="storeSagaData">Will be used to store saga data. Is only relevant if one or more handlers are derived from <see cref="Saga"/>.</param>
        /// <param name="determineDestination">Will be used to resolve a destination in cases where the message destination is not explicitly specified as part of a send/subscribe operation.</param>
        /// <param name="serializeMessages">Will be used to serialize and deserialize transport messages.</param>
        /// <param name="inspectHandlerPipeline">Will be called to inspect the pipeline of handlers constructed to handle an incoming message.</param>
        /// <param name="errorTracker">Will be used to track failed delivery attempts.</param>
        public RebusBus(IActivateHandlers activateHandlers, ISendMessages sendMessages, IReceiveMessages receiveMessages, IStoreSubscriptions storeSubscriptions, IStoreSagaData storeSagaData, IDetermineDestination determineDestination, ISerializeMessages serializeMessages, IInspectHandlerPipeline inspectHandlerPipeline, IErrorTracker errorTracker)
        {
            this.activateHandlers       = activateHandlers;
            this.sendMessages           = sendMessages;
            this.receiveMessages        = receiveMessages;
            this.storeSubscriptions     = storeSubscriptions;
            this.determineDestination   = determineDestination;
            this.serializeMessages      = serializeMessages;
            this.storeSagaData          = storeSagaData;
            this.inspectHandlerPipeline = inspectHandlerPipeline;
            this.errorTracker           = errorTracker;

            batch   = new RebusBatchOperations(determineDestination, storeSubscriptions, this);
            routing = new RebusRouting(this);

            rebusId = Interlocked.Increment(ref rebusIdCounter);

            log.Info("Rebus bus created");
        }
コード例 #5
0
 public void Use(IDetermineDestination determineDestination)
 {
     Backbone.DetermineDestination = determineDestination;
 }
コード例 #6
0
 public void Use(IDetermineDestination determineDestination)
 {
     Backbone.DetermineDestination = determineDestination;
 }
コード例 #7
0
 public RebusBatchOperations(IDetermineDestination determineDestination, IStoreSubscriptions storeSubscriptions, RebusBus bus)
 {
     this.determineDestination = determineDestination;
     this.storeSubscriptions   = storeSubscriptions;
     this.bus = bus;
 }
コード例 #8
0
 public RebusBatchOperations(IDetermineDestination determineDestination, IStoreSubscriptions storeSubscriptions, RebusBus bus)
 {
     this.determineDestination = determineDestination;
     this.storeSubscriptions = storeSubscriptions;
     this.bus = bus;
 }