-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
feat(rabbitmq): add a new property handlers to RabbitMQModule config #446
feat(rabbitmq): add a new property handlers to RabbitMQModule config #446
Conversation
It was added a new property called handlers to RabbitMQModule config in order to be able to use dynamic values in handler configs. fix golevelup#445
Would it not make more sense to have |
Hello @danocmx |
I assume the handler name should be unique, which would be easier to manage in an object as property name. |
You right! I hadn't thought of that. It's simpler to solve this with objects. I will do the change. |
I personally think it would be better to just force your config resolution to happen before decorators are resolved. Managing your App Configuration through the framework DI system is an antipattern in my opinion but I also realize that most people who build Nest apps are just used to doing things this way so its not worth fighting against the conventions at this point. With that in mind I'm open to adding this new API but want to make sure there's some e2e test coverage added before we can merge |
@WonderPanda |
All of your points can be achieved pretty easily by parsing configuration prior to bootstrapping the Nest application and outside of the DI system which provides the added benefit of allowing you to use config values directly inside of your decorator function calls. However, since it seems like most Nest apps use the Nest config service it's probably worth it to provide the workaround that you've implemented here |
Publish this feature, I'm looking forward to using it ; ) |
@thiagoanselmo Published as @golevelup/[email protected] |
I have the latest version of the 3.2.0 package, but it's still not working. It gives the console it took as handler settings, it doesn't initialize the consumer.. When I check the RabbitMQ GUI there is no active consumer. |
@thiagoanselmo my fix for #489 made it into 3.3.0 that was released recently. Let me know if it works for you. |
@chromey Yes, working for me the version 3.4.0 Thanks!! |
It was added a new property called handlers to RabbitMQModule config in order to be able to use
dynamic values in handler configs.
Example RabbitMQModule config:
Example Subscription decorator:
Fix issue #445