public MessageRouter( IDisposable disposer, IHandleUnitOfWork unitOfWork, ITransportMessages messageTransport, ITrackMessageHandlers handlerTable, IHandlePoisonMessages poisonMessageHandler) { this.disposer = disposer; this.unitOfWork = unitOfWork; this.messageTransport = messageTransport; this.handlerTable = handlerTable; this.poisonMessageHandler = poisonMessageHandler; this.ContinueProcessing = true; }
private static void DispatchCommit(ILifetimeScope container, Commit commit) { using (var scope = container.BeginLifetimeScope()) { NanoMessageBus.IPublishMessages publisher = scope.Resolve <NanoMessageBus.IPublishMessages>(); publisher.Publish(commit.Events.Select(e => e.Body).ToArray()); // need to complete and dispose the uow to do the actual publishing since // the IHandleUnitOfWork is registered as ExternalyOwned using (IHandleUnitOfWork uow = scope.Resolve <IHandleUnitOfWork>()) { uow.Complete(); } } }
private static void DispatchCommit(ILifetimeScope container, Commit commit) { // TODO: the process might crash after the commit has been writen to the eventstore // but before we have a chance to publish the messages to the bus. using (var scope = container.BeginLifetimeScope()) { NanoMessageBus.IPublishMessages publisher = scope.Resolve <NanoMessageBus.IPublishMessages>(); publisher.Publish(commit.Events.Select(e => e.Body).ToArray()); // need to complete and dispose the uow to do the actual publishing since // the IHandleUnitOfWork is registered as ExternalyOwned using (IHandleUnitOfWork uow = scope.Resolve <IHandleUnitOfWork>()) { uow.Complete(); } } }
public TransactionalBus(IHandleUnitOfWork unitOfWork, MessageBus inner) { // Null UoW? this.unitOfWork = unitOfWork; this.inner = inner; }
public TransactionalBus(IHandleUnitOfWork unitOfWork, MessageBus inner) { this.unitOfWork = unitOfWork; this.inner = inner; }