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

Create a more Unified Config and Module Bootstrap Experience for RabbitMQ #34

Closed
WonderPanda opened this issue Apr 3, 2019 · 3 comments · Fixed by #37
Closed

Create a more Unified Config and Module Bootstrap Experience for RabbitMQ #34

WonderPanda opened this issue Apr 3, 2019 · 3 comments · Fixed by #37
Assignees
Labels
enhancement New feature or request

Comments

@WonderPanda
Copy link
Collaborator

Update the RabbitMQModule builder methods to use the forRoot and forRootAsync to stay with the conventions of the existing NestJS ecosystem. Investigate a better way to allow for injection of a config service to allow people to pull the necessary AMQP config information from their existing tools for config management.

@WonderPanda WonderPanda added the enhancement New feature or request label Apr 3, 2019
@WonderPanda WonderPanda self-assigned this Apr 3, 2019
WonderPanda added a commit that referenced this issue Apr 7, 2019
use community convention of forRoot and forRootAsync to bootstrap module

fix #34
WonderPanda added a commit that referenced this issue Apr 7, 2019
use community convention of forRoot and forRootAsync to bootstrap module

fix #34
@WonderPanda
Copy link
Collaborator Author

@kjetilhp The newest published versions of @nestjs-plus/rabbitmq contain the forRoot and forRootAsync static configuration methods

@kjetilhp
Copy link

Nice, tested the new package, so what I wanted works:

RabbitMQModule.forRootAsync({
      useFactory: async (configService: ConfigService) => {
        return await configService.messagingConfig()
      },
      inject: [ConfigService],
    }),

@WonderPanda
Copy link
Collaborator Author

Awesome! Glad that it's working out for you. As part of this changed I also added some utility in the @nestjs-plus/common package to facilitate this async configuration pattern. If you're ever building modules that need to support this config pattern feel free to check it out

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

Successfully merging a pull request may close this issue.

2 participants