eventflow / EventFlow

Async/await first CQRS+ES and DDD framework for .NET
https://docs.geteventflow.net/
Other
2.37k stars 445 forks source link

EventStore ReadAllEventsForwardAsync is populating all of the data from all services #802

Closed DureSameen closed 1 year ago

DureSameen commented 3 years ago

We have a single eventstore connected to all microservices. Now we are creating a data retrieval logic, to populate a microservice data in the startup. But the following line populating all data even from other services too. so it is causing exception in serialization

allEventsSlice = await _connection.ReadAllEventsForwardAsync(nextPosition, pageSize, false) ;

How can we populate a single type only i-e only from following types.

var typeList = _dataRetrievalConfiguration.ReadModelAssembly.DefinedTypes.Where(type => type.Name != "LookUpEnumReadModel" && !type.IsInterface && !type.IsAbstract && type.ImplementedInterfaces.Any(inter=> inter == typeof(IReadModel))).ToList(); typeList.ForEach(async x => { await _populator.PopulateAsync(x, cancellationToken); });

rasmus commented 3 years ago

Hi @DureSameen I'm not very familiar with EventStore, but would you be able to create a small exploratory test that illustrate your problem?

If there is a but, we'll need a fix for it.

DureSameen commented 3 years ago

I have created two microservices

https://github.com/DureSameen/EventFlowWithElasticSearch/tree/DataRetreveial https://github.com/maree16/EventFlowForOrganization

The first one include logic of data retrieval.

  1. Create environment variables. as described in readme.
  2. Add some data using both api
  3. Turn on data retrieval switch in write api ,
  4. All data from eventstore will read to the data retrieval routine.
DureSameen commented 3 years ago

any progress on this issue?

rasmus commented 3 years ago

Hi @DureSameen none. The EventStore part of EventFlow is mainly maintained by others. Would you be up for doing a pull request for it?

github-actions[bot] commented 1 year ago

Hello there!

We hope you are doing well. We noticed that this issue has not seen any activity in the past 90 days. We consider this issue to be stale and will be closing it within the next seven days.

If you still require assistance with this issue, please feel free to reopen it or create a new issue.

Thank you for your understanding and cooperation.

Best regards, EventFlow

github-actions[bot] commented 1 year ago

Hello there!

This issue has been closed due to inactivity for seven days. If you believe this issue still needs attention, please feel free to open a new issue or comment on this one to request its reopening.

Thank you for your contribution to this repository.

Best regards, EventFlow