Exemplo n.º 1
0
        public void Start()
        {
            var readerStrategy = ReaderStrategy.Create(
                _querySource.ToJson(),                 // tag
                0,
                _querySource,
                _timeProvider,
                stopOnEof: true,
                runAs: _user);

            //TODO: make reader mode explicit
            var readerOptions = new ReaderSubscriptionOptions(
                1024 * 1024,
                checkpointAfterMs: 10000,
                checkpointProcessedEventsThreshold: null,
                stopOnEof: true,
                stopAfterNEvents: _maxEvents,
                // The projection must be stopped for debugging, so will enable content type validation automatically
                enableContentTypeValidation: true);

            _subscriptionId =
                _subscriptionDispatcher.PublishSubscribe(
                    new ReaderSubscriptionManagement.Subscribe(
                        Guid.NewGuid(), _fromPosition, readerStrategy, readerOptions), this);
        }
Exemplo n.º 2
0
        public void Start()
        {
            var readerStrategy = ReaderStrategy.Create(
                _querySource.ToJson(), // tag
                0,
                _querySource,
                _timeProvider,
                stopOnEof: true,
                runAs: _user);

            //TODO: make reader mode explicit
            var readerOptions = new ReaderSubscriptionOptions(
                1024 * 1024,
                checkpointProcessedEventsThreshold: null,
                stopOnEof: true,
                stopAfterNEvents: _maxEvents);

            _subscriptionId =
                _subscriptionDispatcher.PublishSubscribe(
                    new ReaderSubscriptionManagement.Subscribe(
                        Guid.NewGuid(), _fromPosition, readerStrategy, readerOptions), this);
        }