Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CQRS module lack of support for hybrid microservice #139

Closed
yaniv-marshaly opened this issue Oct 10, 2019 · 5 comments
Closed

CQRS module lack of support for hybrid microservice #139

yaniv-marshaly opened this issue Oct 10, 2019 · 5 comments

Comments

@yaniv-marshaly
Copy link

Bug Report

Current behavior

Hello,
I'm building a microservice that will support both TCP and RMQ connections,

If I use the regular microservice set up for my project the CQRS works great.
like so:

` const microserviceOptions = {
transport: Transport.RMQ,
options: {
queue: 'data',
urls: ['amqp://localhost:5672'],
},
}

const app = await NestFactory.createMicroservice(AppModule, microserviceOptions);
app.listen(() => console.log("Microservice is listening"));`

but if change it to support hybrid application I get the

CommandHandler not found exception!

` const microserviceOptions = {
transport: Transport.RMQ,
options: {
queue: 'data',
urls: ['amqp://localhost:5672'],
},
};

const app = await NestFactory.create(AppModule);
app.connectMicroservice(microserviceOptions);
app.startAllMicroservices(() => console.log('Microservice is listening'));`

Environment


Nest version: 6.0.0
 
For Tooling issues:
- Node version: 10.14.1
- Platform:  Mac

Others:
using VSCode
@kamilmysliwiec
Copy link
Member

Please, provide a minimal repository which reproduces your issue.

@kamilmysliwiec kamilmysliwiec transferred this issue from nestjs/nest Oct 10, 2019
@yaniv-marshaly
Copy link
Author

yaniv-marshaly commented Oct 10, 2019

https://github.com/Yanivox/nest-cqrs-example
Screen Shot 2019-10-10 at 15 41 23

@yaniv-marshaly
Copy link
Author

yaniv-marshaly commented Oct 10, 2019

I found the solution for this bug.
need to init the nest application module
I'll make a pull request
Screen Shot 2019-10-10 at 19 33 05

@kamilmysliwiec
Copy link
Member

Let's track this issue here nestjs/nest#3153

@Samox
Copy link

Samox commented Mar 24, 2022

Can we re-open this issue? We use CQRS and we'd like hybrid applications (in order to add a /healthcheck endpoint on our microservice process).
Here is a repository with the issue https://github.com/Samox/nestjs-microservices-example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants