public Worker(IErrorTracker errorTracker, IReceiveMessages receiveMessages, IActivateHandlers activateHandlers, IStoreSubscriptions storeSubscriptions, ISerializeMessages serializeMessages, IStoreSagaData storeSagaData, IInspectHandlerPipeline inspectHandlerPipeline, string workerThreadName, IHandleDeferredMessage handleDeferredMessage, IMutateIncomingMessages mutateIncomingMessages) { this.receiveMessages = receiveMessages; this.serializeMessages = serializeMessages; this.mutateIncomingMessages = mutateIncomingMessages; this.errorTracker = errorTracker; dispatcher = new Dispatcher(storeSagaData, activateHandlers, storeSubscriptions, inspectHandlerPipeline, handleDeferredMessage); dispatcher.UncorrelatedMessage += RaiseUncorrelatedMessage; workerThread = new Thread(MainLoop) { Name = workerThreadName }; workerThread.Start(); log.Info("Worker {0} created and inner thread started", WorkerThreadName); }
public Transport(IReceiveMessages messageReceiver, IContainer container, ModulePipeFactory<IncomingMessageContext> incomingPipeline, ModulePipeFactory<OutgoingMessageContext> outgoingPipeline) { this.messageReceiver = messageReceiver; this.container = container; this.incomingPipeline = incomingPipeline; this.outgoingPipeline = outgoingPipeline; }
void DoWork(IReceiveMessages messageQueue) { try { using (var tx = new TransactionScope()) { var ctx = new AmbientTransactionContext(); var receivedTransportMessage = messageQueue.ReceiveMessage(ctx); if (receivedTransportMessage == null) return; try { SendMessage(receivedTransportMessage); tx.Complete(); } catch (Exception e) { log.Error(e, "Could not send message {0} to destination URI {1} - waiting 1 sec before retrying", receivedTransportMessage.Id, destinationUri); Thread.Sleep(TimeSpan.FromSeconds(1)); } } } catch (Exception e) { log.Error("Unhandled exception during receive operation", e); } }
void DoWork(IReceiveMessages messageQueue) { try { using (var tx = new TransactionScope()) { var ctx = new AmbientTransactionContext(); var receivedTransportMessage = messageQueue.ReceiveMessage(ctx); if (receivedTransportMessage == null) { return; } try { SendMessage(receivedTransportMessage); tx.Complete(); } catch (Exception e) { log.Error(e, "Could not send message {0} to destination URI {1} - waiting 1 sec before retrying", receivedTransportMessage.Id, destinationUri); Thread.Sleep(TimeSpan.FromSeconds(1)); } } } catch (Exception e) { log.Error("Unhandled exception during receive operation", e); } }
public Worker(IErrorTracker errorTracker, IReceiveMessages receiveMessages, IActivateHandlers activateHandlers, IStoreSubscriptions storeSubscriptions, ISerializeMessages serializeMessages, IStoreSagaData storeSagaData, IInspectHandlerPipeline inspectHandlerPipeline, string workerThreadName, IHandleDeferredMessage handleDeferredMessage, IMutateIncomingMessages mutateIncomingMessages, IStoreTimeouts storeTimeouts, IEnumerable <IUnitOfWorkManager> unitOfWorkManagers, ConfigureAdditionalBehavior configureAdditionalBehavior, MessageLogger messageLogger) { this.receiveMessages = receiveMessages; this.serializeMessages = serializeMessages; this.mutateIncomingMessages = mutateIncomingMessages; this.unitOfWorkManagers = unitOfWorkManagers; this.configureAdditionalBehavior = configureAdditionalBehavior; this.messageLogger = messageLogger; this.errorTracker = errorTracker; dispatcher = new Dispatcher(storeSagaData, activateHandlers, storeSubscriptions, inspectHandlerPipeline, handleDeferredMessage, storeTimeouts); dispatcher.UncorrelatedMessage += RaiseUncorrelatedMessage; nullMessageReceivedBackoffHelper = CreateBackoffHelper(configureAdditionalBehavior.BackoffBehavior); workerThread = new Thread(MainLoop) { Name = workerThreadName }; workerThread.Start(); log.Info("Worker {0} created and inner thread started", WorkerThreadName); }
/// <summary> /// Initializes a new instance of the <see cref="MessageProcessing"/> class. /// </summary> /// <param name="receiveMessages">The receive messages.</param> /// <param name="messageContextFactory">The message context factory.</param> /// <param name="queueWaitFactory">The queue wait factory.</param> /// <param name="log">The log.</param> /// <param name="processMessage">The process message.</param> /// <param name="receivePoisonMessage">The receive poison message.</param> /// <param name="rollbackMessage">rolls back a message when an exception occurs</param> public MessageProcessing( IReceiveMessagesFactory receiveMessages, IMessageContextFactory messageContextFactory, IQueueWaitFactory queueWaitFactory, ILogFactory log, ProcessMessage processMessage, IReceivePoisonMessage receivePoisonMessage, IRollbackMessage rollbackMessage) { Guard.NotNull(() => receiveMessages, receiveMessages); Guard.NotNull(() => messageContextFactory, messageContextFactory); Guard.NotNull(() => queueWaitFactory, queueWaitFactory); Guard.NotNull(() => log, log); Guard.NotNull(() => processMessage, processMessage); Guard.NotNull(() => receivePoisonMessage, receivePoisonMessage); Guard.NotNull(() => rollbackMessage, rollbackMessage); _receiveMessages = receiveMessages.Create(); _messageContextFactory = messageContextFactory; _log = log.Create(); _processMessage = processMessage; _receivePoisonMessage = receivePoisonMessage; _rollbackMessage = rollbackMessage; _noMessageToProcessBackOffHelper = new Lazy <IQueueWait>(queueWaitFactory.CreateQueueDelay); _seriousExceptionProcessBackOffHelper = new Lazy <IQueueWait>(queueWaitFactory.CreateFatalErrorDelay); }
/// <summary> /// Initializes a new instance of the <see cref="ReceiveMessagesPolicyDecorator" /> class. /// </summary> public ReceiveMessagesPolicyDecorator(IPolicies policies, IReceiveMessages handler) { Guard.NotNull(() => policies, policies); Guard.NotNull(() => handler, handler); _policies = policies; _handler = handler; }
protected override void DoSetUp() { factory = new TFactory(); var transports = factory.Create(); sender = transports.Item1; receiver = transports.Item2; }
static IEnumerable<ReceivedTransportMessage> GetAllTheMessages(IReceiveMessages messageQueue, ITransactionContext transactionContext) { var messages = new List<ReceivedTransportMessage>(); ReceivedTransportMessage transportMessage; while ((transportMessage = messageQueue.ReceiveMessage(transactionContext)) != null) { messages.Add(transportMessage); } return messages; }
/// <summary> /// Uses the specified implementation of <see cref="IReceiveMessages"/> to receive messages /// </summary> public void UseReceiver(IReceiveMessages receiveMessages) { Backbone.ReceiveMessages = receiveMessages; // if we see the OneWayClientGag, the bus will not be able to receive messages // - therefore, we configure the behavior if (receiveMessages is OneWayClientGag) { Backbone.AddConfigurationStep(s => s.AdditionalBehavior.EnterOneWayClientMode()); } }
public RijndaelEncryptionTransportDecorator(ISendMessages innerSendMessages, IReceiveMessages innerReceiveMessages, string ivBase64, string keyBase64) { this.innerSendMessages = innerSendMessages; this.innerReceiveMessages = innerReceiveMessages; Rijndael.IV = Convert.FromBase64String(ivBase64); Rijndael.Key = Convert.FromBase64String(keyBase64); encryptor = Rijndael.CreateEncryptor(); decryptor = Rijndael.CreateDecryptor(); }
public MessageProcessingWrapper() { _fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); ReceiveMessages = _fixture.Create<IReceiveMessages>(); var factory = _fixture.Create<IReceiveMessagesFactory>(); factory.Create().ReturnsForAnyArgs(ReceiveMessages); _fixture.Inject(factory); MessageContextFactory = _fixture.Create<IMessageContextFactory>(); _fixture.Inject(ReceiveMessages); _fixture.Inject(MessageContextFactory); }
void Initialize(IStoreTimeouts storeTimeouts, ISendMessages sendMessages, IReceiveMessages receiveMessages) { this.storeTimeouts = storeTimeouts; rebusBus = new RebusBus(this, sendMessages, receiveMessages, null, null, null, new JsonMessageSerializer(), new TrivialPipelineInspector(), new ErrorTracker(receiveMessages.InputQueueAddress + ".error")); bus = rebusBus; timer.Interval = 300; timer.Elapsed += CheckCallbacks; }
static IEnumerable <ReceivedTransportMessage> GetAllTheMessages(IReceiveMessages messageQueue, ITransactionContext transactionContext) { var messages = new List <ReceivedTransportMessage>(); ReceivedTransportMessage transportMessage; while ((transportMessage = messageQueue.ReceiveMessage(transactionContext)) != null) { messages.Add(transportMessage); } return(messages); }
public MessageProcessingWrapper() { _fixture = new Fixture().Customize(new AutoNSubstituteCustomization()); ReceiveMessages = _fixture.Create <IReceiveMessages>(); var factory = _fixture.Create <IReceiveMessagesFactory>(); factory.Create().ReturnsForAnyArgs(ReceiveMessages); _fixture.Inject(factory); MessageContextFactory = _fixture.Create <IMessageContextFactory>(); _fixture.Inject(ReceiveMessages); _fixture.Inject(MessageContextFactory); }
/// <summary> /// Initializes a new instance of the <see cref="ReceiveMessagesDecorator" /> class. /// </summary> /// <param name="metrics">The metrics factory.</param> /// <param name="headers">The headers.</param> /// <param name="getTime">The get time.</param> /// <param name="handler">The handler.</param> /// <param name="connectionInformation">The connection information.</param> public ReceiveMessagesDecorator(IMetrics metrics, IHeaders headers, IGetTimeFactory getTime, IReceiveMessages handler, IConnectionInformation connectionInformation) { var name = handler.GetType().Name; _meter = metrics.Meter($"{connectionInformation.QueueName}.{name}.ReceiveMessageMeter", Units.Items); _waitTimer = metrics.Timer($"{connectionInformation.QueueName}.{name}.WaitForDeQueueMeter", Units.None); _handler = handler; _getTime = getTime; _headers = headers; }
void Initialize(IStoreTimeouts storeTimeouts, ISendMessages sendMessages, IReceiveMessages receiveMessages, string errorQueueName) { var errorQueuePath = MsmqUtil.GetPath(errorQueueName); MsmqUtil.EnsureMessageQueueExists(errorQueuePath); MsmqUtil.EnsureMessageQueueIsTransactional(errorQueuePath); rebusBus = new RebusBus(this, sendMessages, receiveMessages, null, null, null, new JsonMessageSerializer(), new TrivialPipelineInspector(), new ErrorTracker(errorQueueName), storeTimeouts, new ConfigureAdditionalBehavior()); }
/// <summary> /// Initializes a new instance of the <see cref="ReceiveMessagesDecorator" /> class. /// </summary> /// <param name="metrics">The metrics factory.</param> /// <param name="headers">The headers.</param> /// <param name="getTime">The get time.</param> /// <param name="handler">The handler.</param> /// <param name="connectionInformation">The connection information.</param> public ReceiveMessagesDecorator(IMetrics metrics, IHeaders headers, IGetTimeFactory getTime, IReceiveMessages handler, IConnectionInformation connectionInformation) { var name = "ReceiveMessages"; _meter = metrics.Meter($"{connectionInformation.QueueName}.{name}.ReceiveMessageMeter", Units.Items); _waitTimer = metrics.Timer($"{connectionInformation.QueueName}.{name}.WaitForDeQueueMeter", Units.None); _handler = handler; _getTime = getTime; _headers = headers; }
/// <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"); }
protected Worker CreateWorker(IReceiveMessages receiveMessages, IActivateHandlers activateHandlers, IInspectHandlerPipeline inspectHandlerPipeline = null, IEnumerable <IUnitOfWorkManager> unitOfWorkManagers = null, IErrorTracker errorTracker = null) { return(new Worker(errorTracker ?? new ErrorTracker("error"), receiveMessages, activateHandlers, new InMemorySubscriptionStorage(), new JsonMessageSerializer(), new SagaDataPersisterForTesting(), inspectHandlerPipeline ?? new TrivialPipelineInspector(), "Just some test worker", new DeferredMessageHandlerForTesting(), new IncomingMessageMutatorPipelineForTesting(), null, unitOfWorkManagers ?? new IUnitOfWorkManager[0], new ConfigureAdditionalBehavior())); }
/// <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"); }
protected Worker CreateWorker(IReceiveMessages receiveMessages, IActivateHandlers activateHandlers, IInspectHandlerPipeline inspectHandlerPipeline = null, IEnumerable<IUnitOfWorkManager> unitOfWorkManagers = null, IErrorTracker errorTracker = null) { return new Worker(errorTracker ?? new ErrorTracker("error"), receiveMessages, activateHandlers, new InMemorySubscriptionStorage(), new JsonMessageSerializer(), new SagaDataPersisterForTesting(), inspectHandlerPipeline ?? new TrivialPipelineInspector(), "Just some test worker", new DeferredMessageHandlerForTesting(), new IncomingMessageMutatorPipelineForTesting(), null, unitOfWorkManagers ?? new IUnitOfWorkManager[0], new ConfigureAdditionalBehavior()); }
/// <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="determineMessageOwnership">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> /// <param name="storeTimeouts">Optionally provides an internal timeout manager to be used instead of sending timeout requests to an external timeout manager</param> /// <param name="configureAdditionalBehavior"></param> public RebusBus( IActivateHandlers activateHandlers, ISendMessages sendMessages, IReceiveMessages receiveMessages, IStoreSubscriptions storeSubscriptions, IStoreSagaData storeSagaData, IDetermineMessageOwnership determineMessageOwnership, ISerializeMessages serializeMessages, IInspectHandlerPipeline inspectHandlerPipeline, IErrorTracker errorTracker, IStoreTimeouts storeTimeouts, ConfigureAdditionalBehavior configureAdditionalBehavior) { this.activateHandlers = activateHandlers; this.sendMessages = sendMessages; this.receiveMessages = receiveMessages; this.storeSubscriptions = storeSubscriptions; this.determineMessageOwnership = determineMessageOwnership; this.serializeMessages = serializeMessages; this.storeSagaData = storeSagaData; this.inspectHandlerPipeline = inspectHandlerPipeline; this.errorTracker = errorTracker; this.storeTimeouts = storeTimeouts; this.configureAdditionalBehavior = configureAdditionalBehavior; batch = new RebusBatchOperations(determineMessageOwnership, storeSubscriptions, this); routing = new RebusRouting(this); rebusId = Interlocked.Increment(ref rebusIdCounter); continuations = new RebusSynchronizationContext(); log.Info("Rebus bus {0} created", rebusId); if (storeTimeouts == null) { var timeoutManagerEndpointAddress = RebusConfigurationSection .GetConfigurationValueOrDefault(s => s.TimeoutManagerAddress, "rebus.timeout"); log.Info("Using external timeout manager with input queue '{0}'", timeoutManagerEndpointAddress); timeoutManagerAddress = timeoutManagerEndpointAddress; } else { log.Info("Using internal timeout manager"); timeoutManagerAddress = this.receiveMessages.InputQueueAddress; dueTimeoutScheduler = new DueTimeoutScheduler(storeTimeouts, new DeferredMessageReDispatcher(this)); } }
public Worker( IErrorTracker errorTracker, IReceiveMessages receiveMessages, IActivateHandlers activateHandlers, IStoreSubscriptions storeSubscriptions, ISerializeMessages serializeMessages, IStoreSagaData storeSagaData, IInspectHandlerPipeline inspectHandlerPipeline, string workerThreadName, IHandleDeferredMessage handleDeferredMessage, IMutateIncomingMessages mutateIncomingMessages, IStoreTimeouts storeTimeouts, IEnumerable<IUnitOfWorkManager> unitOfWorkManagers, ConfigureAdditionalBehavior configureAdditionalBehavior, MessageLogger messageLogger, RebusSynchronizationContext continuations) { this.receiveMessages = receiveMessages; this.serializeMessages = serializeMessages; this.mutateIncomingMessages = mutateIncomingMessages; this.unitOfWorkManagers = unitOfWorkManagers; this.configureAdditionalBehavior = configureAdditionalBehavior; this.messageLogger = messageLogger; this.continuations = continuations; this.errorTracker = errorTracker; dispatcher = new Dispatcher(storeSagaData, activateHandlers, storeSubscriptions, inspectHandlerPipeline, handleDeferredMessage, storeTimeouts); dispatcher.UncorrelatedMessage += RaiseUncorrelatedMessage; nullMessageReceivedBackoffHelper = CreateBackoffHelper(configureAdditionalBehavior.BackoffBehavior); workerThread = new Thread(MainLoop) { Name = workerThreadName }; workerThread.Start(); log.Info("Worker {0} created and inner thread started", WorkerThreadName); }
/// <summary> /// Initializes a new instance of the <see cref="ReceiveMessagesDecorator"/> class. /// </summary> /// <param name="handler">The handler.</param> /// <param name="tracer">The tracer.</param> /// <param name="headers">The headers.</param> public ReceiveMessagesDecorator(IReceiveMessages handler, ActivitySource tracer, IHeaders headers) { _handler = handler; _tracer = tracer; _headers = headers; }
public DequeueStrategy(IReceiveMessages receiveMessages) { this.receiveMessages = receiveMessages; }
public void UseReceiver(IReceiveMessages receiveMessages) { Backbone.ReceiveMessages = receiveMessages; }
/// <summary> /// Initializes a new instance of the <see cref="ReceiveMessagesDecorator"/> class. /// </summary> /// <param name="handler">The handler.</param> /// <param name="tracer">The tracer.</param> /// <param name="headers">The headers.</param> public ReceiveMessagesDecorator(IReceiveMessages handler, ITracer tracer, IHeaders headers) { _handler = handler; _tracer = tracer; _headers = headers; }
protected override void SetupServer() { this.serverChannel = channelFactory.CreateReceiver(); this.serverChannel.Bind(endpoint); }
public MemoryPublishMessages(IReceiveMessages receiveMessages) { _receiveMessages = receiveMessages; }
public MemorySendMessages(IReceiveMessages receiveMessages) { _receiveMessages = receiveMessages; }
public void Start() { _messageReceiver = _topicReceiverFactory.GetInstance(); _messageReceiver.AddConsumer(_consumer); }
public RijndaelEncryptionTransportDecorator(ISendMessages innerSendMessages, IReceiveMessages innerReceiveMessages, string keyBase64) { this.innerSendMessages = innerSendMessages; this.innerReceiveMessages = innerReceiveMessages; helper = new RijndaelHelper(keyBase64); }
/// <summary> /// Initializes a new instance of the <see cref="MessageProcessing"/> class. /// </summary> /// <param name="receiveMessages">The receive messages.</param> /// <param name="messageContextFactory">The message context factory.</param> /// <param name="queueWaitFactory">The queue wait factory.</param> /// <param name="log">The log.</param> /// <param name="processMessage">The process message.</param> /// <param name="receivePoisonMessage">The receive poison message.</param> /// <param name="rollbackMessage">rolls back a message when an exception occurs</param> public MessageProcessing( IReceiveMessagesFactory receiveMessages, IMessageContextFactory messageContextFactory, IQueueWaitFactory queueWaitFactory, ILogFactory log, ProcessMessage processMessage, IReceivePoisonMessage receivePoisonMessage, IRollbackMessage rollbackMessage) { Guard.NotNull(() => receiveMessages, receiveMessages); Guard.NotNull(() => messageContextFactory, messageContextFactory); Guard.NotNull(() => queueWaitFactory, queueWaitFactory); Guard.NotNull(() => log, log); Guard.NotNull(() => processMessage, processMessage); Guard.NotNull(() => receivePoisonMessage, receivePoisonMessage); Guard.NotNull(() => rollbackMessage, rollbackMessage); _receiveMessages = receiveMessages.Create(); _messageContextFactory = messageContextFactory; _log = log.Create(); _processMessage = processMessage; _receivePoisonMessage = receivePoisonMessage; _rollbackMessage = rollbackMessage; _noMessageToProcessBackoffHelper = new Lazy<IQueueWait>(queueWaitFactory.CreateQueueDelay); _seriousExceptionProcessBackOffHelper = new Lazy<IQueueWait>(queueWaitFactory.CreateFatalErrorDelay); }
public TimeoutService(IStoreTimeouts storeTimeouts, ISendMessages sendMessages, IReceiveMessages receiveMessages) { Initialize(storeTimeouts, sendMessages, receiveMessages, DefaultErrorQueueName); }
/// <summary> /// Constructs the decorator with the specified implementations of <see cref="ISendMessages"/> and <see cref="IReceiveMessages"/>, /// storing the specified base 64-encoded key to be used when encrypting/decrypting messages /// </summary> public EncryptionAndCompressionTransportDecorator(ISendMessages innerSendMessages, IReceiveMessages innerReceiveMessages) { this.innerSendMessages = innerSendMessages; this.innerReceiveMessages = innerReceiveMessages; }
protected virtual Bus CreateBus(IReceiveMessages receiver, IOutgoingPipelineFactory outgoingPipelineFactory, IIncomingPipelineFactory incomingPipelineFactory) { return new Bus(this.configuration, new DequeueStrategy(receiver), outgoingPipelineFactory, incomingPipelineFactory); }
/// <summary> /// Uses the specified implementation of <see cref="IReceiveMessages"/> to receive messages /// </summary> public void UseReceiver(IReceiveMessages receiveMessages) { Backbone.ReceiveMessages = receiveMessages; }
protected virtual Bus CreateBus(IReceiveMessages receiver, IOutgoingPipelineFactory outgoingPipelineFactory, IIncomingPipelineFactory incomingPipelineFactory) { return(new Bus(this.configuration, new DequeueStrategy(receiver), outgoingPipelineFactory, incomingPipelineFactory)); }
/// <summary> /// Constructs the decorator with the specified implementations of <see cref="ISendMessages"/> and <see cref="IReceiveMessages"/>, /// storing the specified base 64-encoded key to be used when encrypting/decrypting messages /// </summary> public RijndaelEncryptionTransportDecorator(ISendMessages innerSendMessages, IReceiveMessages innerReceiveMessages, string keyBase64) { this.innerSendMessages = innerSendMessages; this.innerReceiveMessages = innerReceiveMessages; helper = new RijndaelHelper(keyBase64); }
public TimeoutService(IStoreTimeouts storeTimeouts, ISendMessages sendMessages, IReceiveMessages receiveMessages) { Initialize(storeTimeouts, sendMessages, receiveMessages); }