private static EventStoreHost BuildEventStoreHost(BaseConfiguration cfg, IMessageBus messageBus) { IEventPublisher eventPublisher = EventStoreConfigurationExtensions.GetEventPublisher(cfg, false); if (eventPublisher == null) eventPublisher = new MessageBusEventPublisher(messageBus); IDocumentStoreFactory docStoreFactory = EventStoreConfigurationExtensions.GetDocumentStoreFactory(cfg); EventStoreDB eStore = EventStoreConfigurationExtensions.GetEventStoreDB(cfg); EventStoreHost host = new EventStoreHost(eStore, eventPublisher, docStoreFactory); return host; }
public MessageBusConfiguration(BaseConfiguration cfg) : base(cfg) { }
private static void AutoSubscribeToHandledMessages(BaseConfiguration cfg) { ISubscriptionService subscriptionService = MessageBusConfigurationExtensions.GetSubscriptionService(cfg); IMessageSink messageSink = MessageBusConfigurationExtensions.GetMessageSink(cfg); MessageDispatcher dispatcher = MessageBusConfigurationExtensions.GetDispatcher(cfg); foreach (Type msg in dispatcher.GetHandledMessages()) { if (typeof(IEvent).IsAssignableFrom(msg)) subscriptionService.Subscribe(msg, messageSink); } }
public EventStoreConfiguration(BaseConfiguration cfg) : base(cfg) { }