nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
66.76k stars 7.55k forks source link

EventStore support for nest microservices transport layer #1426

Closed trendchaser4u closed 4 years ago

trendchaser4u commented 5 years ago

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Is there any roadmap to support EventStore transport layer support? In the meantime how to implement nest microservices with Event store in right way?

Bissel commented 5 years ago

Found an interesting article on this topic Medium Micorservices Article, with an example implementation Github Example-nodejs-cqrs-es-swagger, sadly it's for nestjs 5.x and i like to use 6.x for the query-bus.

The problem is that he uses the onModuleInit() function and it is not working in the same way in 6.0 (I become this error-message: There is no matching event handler defined in the remote service)

EDIT: You have to use @EventPattern instead of @MessagePattern in the users.controller.ts and change the onModuleInit() function to

  onModuleInit() {
    this.eventStore.setEventHandlers(this.eventHandlers);
    this.eventStore.bridgeEventsTo((this.event$ as any).subject$);
    this.event$.publisher = this.eventStore;
  }
SMMMN commented 4 years ago

@bissel Would you like to share your solution on Github, that would possibly help me with my problem. I have currently problems getting the bridgeEventsTo() function to work.

kss943 commented 4 years ago

@Bissel Can you clarify your solution? In these project work only commands. Sagas and also events do not work. How to force saga to work?

kamilmysliwiec commented 4 years ago

W are actively working on updating the documentation to provide more and more examples. Hopefully, we'll deliver something on event store implementation shortly.

juicycleff commented 4 years ago

You could use this https://github.com/juicycleff/nestjs-event-store

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.