Exemplo n.º 1
0
            protected override async Task OnStart(IMessageSession session)
            {
                Logger.Write(LogLevel.Info, "Starting domain");
                await session.Publish <DomainAlive>(x =>
                {
                    x.Endpoint = _settings.InstanceSpecificQueue();
                    x.Instance = Aggregates.Defaults.Instance;
                }).ConfigureAwait(false);

                Logger.Write(LogLevel.Info, "Starting snapshot consumer");
                await _subscriber.Setup(_settings.EndpointName()).ConfigureAwait(false);

                await _subscriber.Subscribe(_cancellationTokenSource.Token).ConfigureAwait(false);
            }