juicycleff / nestjs-event-store

NestJS CQRS module for EventStore.org. It requires @nestjs/cqrs

Home Page:https://xraph.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot publish to stream with aggregate ID in stream name

clarkstachio opened this issue · comments

I am not able to publish to a stream with the related aggregate ID as part of the stream name. I would like to publish to a stream with the name "widget-223434", where 223434 is the aggregate root ID and widget is the aggregate class. This is handled by @daypaio in the nestjs-eventstore in his EventPublisher implementation.

It seems the only way to set the stream name when publishing is when importing NestjsEventStoreModule with the forFeature method and passing in config with the featureStreamName set. When specifying the stream name here it is constant for the module and there is no way to reference the aggregateID as part of the stream.

Is this use case being considered? Am I misunderstanding how to implement this?

@clarkstachio I believe you are correct in understanding. Or at least, we're both wrong 😄 .

It seems like you can only have a single stream for all events for a given module.

@robodude666 you are correct indeed, you can only have a single stream for all events in any given module. It was designed specifically to behave this way

@clarkstachio please could you explain better what you're trying to achieve? You can take a look at https://github.com/juicycleff/ultimate-backend to see how I'm using it there :)