protected override void Load(ContainerBuilder builder) { IWireup wireup = new WireupModule(); wireup = wireup.Configure <LoggingWireup>() .UseLog4Net(); wireup = wireup.Configure <TransportWireup>() .ReceiveWith(1.Threads()); // number of threads to use for handlers wireup = wireup.Configure <SerializationWireup>() .JsonSerializer() .CompressMessages(); wireup = wireup.Configure <EndpointWireup>() .ListenOn("msmq://./Sample.AppService") .ForwardPoisonMessagesTo("msmq://./Sample.Error") .RetryAtLeast(3.Times()); wireup = wireup.Configure <SubscriptionStorageWireup>() .ConnectTo("SubscriptionStorage"); Type[] commandTypes = new Type[] { typeof(CreatePerson), typeof(MovePerson), typeof(KillPerson), typeof(CreateDocument), typeof(CreateShareClass), typeof(AssociateShareClassToDocument) }; wireup = wireup.Configure <MessageBusWireup>() .RegisterMessageEndpoint("msmq://./Sample.AppService", commandTypes) .RegisterMessageTimeToLive(TimeSpan.MaxValue, commandTypes) .RegisterTransientMessage(commandTypes); builder.RegisterType <CreatePersonCommandHandler>(); builder.RegisterType <MovePersonCommandHandler>(); builder.RegisterType <KillPersonCommandHandler>(); builder.RegisterType <CreateDocumentCommandHandler>(); builder.RegisterType <CreateShareClassCommandHandler>(); builder.RegisterType <AssociateShareClassToDocumentCommandHandler>(); wireup = wireup.Configure <MessageHandlerWireup>() .AddHandler(c => c.Resolve <CreatePersonCommandHandler>()) .AddHandler(c => c.Resolve <MovePersonCommandHandler>()) .AddHandler(c => c.Resolve <KillPersonCommandHandler>()) .AddHandler(c => c.Resolve <CreateDocumentCommandHandler>()) .AddHandler(c => c.Resolve <CreateShareClassCommandHandler>()) .AddHandler(c => c.Resolve <AssociateShareClassToDocumentCommandHandler>()); wireup.Register(builder); builder.RegisterType <TransactionScopeUnitOfWork>() .As <IHandleUnitOfWork>() .InstancePerLifetimeScope() .ExternallyOwned(); }
protected override void Load(ContainerBuilder builder) { IWireup wireup = new WireupModule(); wireup = wireup.Configure<LoggingWireup>() .UseLog4Net(); wireup = wireup.Configure<TransportWireup>() .ReceiveWith(1.Threads()); // number of threads to use for handlers wireup = wireup.Configure<SerializationWireup>() .JsonSerializer() .CompressMessages(); wireup = wireup.Configure<EndpointWireup>() .ListenOn("msmq://./Sample.AppService") .ForwardPoisonMessagesTo("msmq://./Sample.Error") .RetryAtLeast(3.Times()); wireup = wireup.Configure<SubscriptionStorageWireup>() .ConnectTo("SubscriptionStorage"); Type[] commandTypes = new Type[] { typeof(CreatePerson), typeof(MovePerson), typeof(KillPerson), typeof(CreateDocument), typeof(CreateShareClass), typeof(AssociateShareClassToDocument) }; wireup = wireup.Configure<MessageBusWireup>() .RegisterMessageEndpoint("msmq://./Sample.AppService", commandTypes) .RegisterMessageTimeToLive(TimeSpan.MaxValue, commandTypes) .RegisterTransientMessage(commandTypes); builder.RegisterType<CreatePersonCommandHandler>(); builder.RegisterType<MovePersonCommandHandler>(); builder.RegisterType<KillPersonCommandHandler>(); builder.RegisterType<CreateDocumentCommandHandler>(); builder.RegisterType<CreateShareClassCommandHandler>(); builder.RegisterType<AssociateShareClassToDocumentCommandHandler>(); wireup = wireup.Configure<MessageHandlerWireup>() .AddHandler(c => c.Resolve<CreatePersonCommandHandler>()) .AddHandler(c => c.Resolve<MovePersonCommandHandler>()) .AddHandler(c => c.Resolve<KillPersonCommandHandler>()) .AddHandler(c => c.Resolve<CreateDocumentCommandHandler>()) .AddHandler(c => c.Resolve<CreateShareClassCommandHandler>()) .AddHandler(c => c.Resolve<AssociateShareClassToDocumentCommandHandler>()); wireup.Register(builder); builder.RegisterType<TransactionScopeUnitOfWork>() .As<IHandleUnitOfWork>() .InstancePerLifetimeScope() .ExternallyOwned(); }
protected override void Load(ContainerBuilder builder) { IWireup wireup = new WireupModule(); wireup = wireup.Configure <LoggingWireup>() .UseLog4Net(); wireup = wireup.Configure <TransportWireup>() .ReceiveWith(1.Threads()); wireup = wireup.Configure <SerializationWireup>() .WithJsonSerializer() .CompressMessages(); wireup = wireup.Configure <EndpointWireup>() .ListenOn("msmq://./Sample.Client") .ForwardPoisonMessagesTo("msmq://./Sample.Error") .RetryAtLeast(3.Times()); Type[] messageTypes = new Type[] { typeof(CreatePerson), typeof(MovePerson), typeof(KillPerson), typeof(CreateDocument), typeof(CreateShareClass), typeof(AssociateShareClassToDocument) }; wireup = wireup.Configure <MessageBusWireup>() .RegisterMessageEndpoint("msmq://./Sample.AppService", messageTypes) .RegisterMessageTimeToLive(TimeSpan.MaxValue, messageTypes) .RegisterTransientMessage(messageTypes); wireup.Register(builder); builder.RegisterType <TransactionScopeUnitOfWork>() .As <IHandleUnitOfWork>() .OnRelease(u => u.Complete()) .InstancePerHttpRequest() .OwnedByLifetimeScope(); }
protected override void Load(ContainerBuilder builder) { IWireup wireup = new WireupModule(); wireup = wireup.Configure <LoggingWireup>() .UseLog4Net(); wireup = wireup.Configure <TransportWireup>() .ReceiveWith(1.Threads()); wireup = wireup.Configure <SerializationWireup>() .JsonSerializer() .CompressMessages(); wireup = wireup.Configure <EndpointWireup>() .ListenOn("msmq://./Sample.Denormalizer") .ForwardPoisonMessagesTo("msmq://./Sample.Error") .RetryAtLeast(3.Times()); wireup = wireup.Configure <MessageSubscriberWireup>() .AddSubscription("msmq://./Sample.AppService", typeof(PersonCreated), typeof(PersonMoved), typeof(PersonDied), typeof(DocumentCreated), typeof(ShareClassCreated), typeof(DocumentAssociatedWithShareclass)); builder.RegisterType <PersonUpdater>(); builder.RegisterType <AddressChangesUpdater>(); builder.RegisterType <DocumentUpdater>(); builder.RegisterType <ShareClassUpdater>(); wireup = wireup.Configure <MessageHandlerWireup>() .AddHandler <PersonCreated>(c => c.Resolve <PersonUpdater>()) .AddHandler <PersonMoved>(c => c.Resolve <PersonUpdater>()) .AddHandler <PersonDied>(c => c.Resolve <PersonUpdater>()) .AddHandler <PersonMoved>(c => c.Resolve <AddressChangesUpdater>()) .AddHandler <DocumentCreated>(c => c.Resolve <DocumentUpdater>()) .AddHandler <DocumentAssociatedWithShareclass>(c => c.Resolve <DocumentUpdater>()) .AddHandler <ShareClassCreated>(c => c.Resolve <ShareClassUpdater>()); wireup.Register(builder); }
protected override void Load(ContainerBuilder builder) { IWireup wireup = new WireupModule(); wireup = wireup.Configure<LoggingWireup>() .UseLog4Net(); wireup = wireup.Configure<TransportWireup>() .ReceiveWith(1.Threads()); wireup = wireup.Configure<SerializationWireup>() .WithJsonSerializer() .CompressMessages(); wireup = wireup.Configure<EndpointWireup>() .ListenOn("msmq://./Sample.Denormalizer") .ForwardPoisonMessagesTo("msmq://./Sample.Error") .RetryAtLeast(3.Times()); wireup = wireup.Configure<MessageSubscriberWireup>() .AddSubscription("msmq://./Sample.AppService", typeof(PersonCreated), typeof(PersonMoved), typeof(PersonDied), typeof(DocumentCreated), typeof(ShareClassCreated), typeof(DocumentAssociatedWithShareclass)); builder.RegisterType<PersonUpdater>(); builder.RegisterType<AddressChangesUpdater>(); builder.RegisterType<DocumentUpdater>(); builder.RegisterType<ShareClassUpdater>(); wireup = wireup.Configure<MessageHandlerWireup>() .AddHandler<PersonCreated>(c => c.Resolve<PersonUpdater>()) .AddHandler<PersonMoved>(c => c.Resolve<PersonUpdater>()) .AddHandler<PersonDied>(c => c.Resolve<PersonUpdater>()) .AddHandler<PersonMoved>(c => c.Resolve<AddressChangesUpdater>()) .AddHandler<DocumentCreated>(c => c.Resolve<DocumentUpdater>()) .AddHandler<DocumentAssociatedWithShareclass>(c => c.Resolve<DocumentUpdater>()) .AddHandler<ShareClassCreated>(c => c.Resolve<ShareClassUpdater>()); wireup.Register(builder); }
protected override void Load(ContainerBuilder builder) { IWireup wireup = new WireupModule(); wireup = wireup.Configure<LoggingWireup>() .UseLog4Net(); wireup = wireup.Configure<TransportWireup>() .ReceiveWith(1.Threads()); wireup = wireup.Configure<SerializationWireup>() .WithJsonSerializer() .CompressMessages(); wireup = wireup.Configure<EndpointWireup>() .ListenOn("msmq://./Sample.Client") .ForwardPoisonMessagesTo("msmq://./Sample.Error") .RetryAtLeast(3.Times()); Type[] messageTypes = new Type[] { typeof(CreatePerson), typeof(MovePerson), typeof(KillPerson), typeof(CreateDocument), typeof(CreateShareClass), typeof(AssociateShareClassToDocument) }; wireup = wireup.Configure<MessageBusWireup>() .RegisterMessageEndpoint("msmq://./Sample.AppService", messageTypes ) .RegisterMessageTimeToLive(TimeSpan.MaxValue, messageTypes) .RegisterTransientMessage(messageTypes); wireup.Register(builder); builder.RegisterType<TransactionScopeUnitOfWork>() .As<IHandleUnitOfWork>() .OnRelease(u => u.Complete()) .InstancePerHttpRequest() .OwnedByLifetimeScope(); }
protected override void Load(ContainerBuilder builder) { IWireup wireup = new WireupModule(); wireup = wireup.Configure<LoggingWireup>() .UseOutputWindow(); wireup = wireup.Configure<TransportWireup>() .ReceiveWith(1.Threads()); wireup = wireup.Configure<SerializationWireup>() .CompressMessages() .EncryptMessages(new byte[16]) .ProtocolBufferSerializer(typeof(SubscriptionRequestMessage), typeof(MyMessage)); wireup = wireup.Configure<EndpointWireup>() .ListenOn("msmq://./MyReceiverQueue") .ForwardPoisonMessagesTo("msmq://./Error") .RetryAtLeast(3.Times()); //// .IgnoreTransactions(); wireup = wireup.Configure<SubscriptionStorageWireup>() .ConnectTo("SubscriptionStorage"); wireup = wireup.Configure<MessageSubscriberWireup>() .AddSubscription("msmq://./MyReceiverQueue", typeof(MyMessage)); wireup = wireup.Configure<MessageBusWireup>() .RegisterMessageEndpoint("msmq://./MyReceiverQueue", typeof(MyMessage)) .RegisterMessageTimeToLive(TimeSpan.MaxValue, typeof(MyMessage)) .RegisterTransientMessage(typeof(MyMessage)); wireup = wireup.Configure<MessageHandlerWireup>() .AddHandler(new MyMessageHandler()); wireup.Register(builder); }
protected override void Load(ContainerBuilder builder) { IWireup wireup = new WireupModule(); wireup = wireup.Configure <LoggingWireup>() .UseOutputWindow(); wireup = wireup.Configure <TransportWireup>() .ReceiveWith(1.Threads()); wireup = wireup.Configure <SerializationWireup>() .CompressMessages() .EncryptMessages(new byte[16]) .ProtocolBufferSerializer(typeof(SubscriptionRequestMessage), typeof(MyMessage)); wireup = wireup.Configure <EndpointWireup>() .ListenOn("msmq://./MyReceiverQueue") .ForwardPoisonMessagesTo("msmq://./Error") .RetryAtLeast(3.Times()); //// .IgnoreTransactions(); wireup = wireup.Configure <SubscriptionStorageWireup>() .ConnectTo("SubscriptionStorage"); wireup = wireup.Configure <MessageSubscriberWireup>() .AddSubscription("msmq://./MyReceiverQueue", typeof(MyMessage)); wireup = wireup.Configure <MessageBusWireup>() .RegisterMessageEndpoint("msmq://./MyReceiverQueue", typeof(MyMessage)) .RegisterMessageTimeToLive(TimeSpan.MaxValue, typeof(MyMessage)) .RegisterTransientMessage(typeof(MyMessage)); wireup = wireup.Configure <MessageHandlerWireup>() .AddHandler(new MyMessageHandler()); wireup.Register(builder); }