Nest: EventStore support for nest microservices transport layer

Created on 7 Jan 2019  路  6Comments  路  Source: nestjs/nest

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?

microservices question 馃檶

Most helpful comment

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;
  }

All 6 comments

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;
  }

@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.

@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?

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anyx picture anyx  路  3Comments

cojack picture cojack  路  3Comments

yanshuf0 picture yanshuf0  路  3Comments

rafal-rudnicki picture rafal-rudnicki  路  3Comments

thohoh picture thohoh  路  3Comments