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

Questions about implementation #41

Closed
mcblum opened this issue Aug 16, 2019 · 7 comments
Closed

Questions about implementation #41

mcblum opened this issue Aug 16, 2019 · 7 comments

Comments

@mcblum
Copy link

mcblum commented Aug 16, 2019

Sorry for the multiple issues! Got everything working and I see the exchanges are created. Is there a process to create queue bindings or should that be implemented manually in the app?

Thank you!

@mcblum
Copy link
Author

mcblum commented Aug 16, 2019

Edit: Ok apparently I asked the wrong question. I see the binding, but for some reason the handler function never actually gets triggered. I've tried using * for a routing key, and using a specific routing key. In Rabbit, all of the messages look like this:

Screen Shot 2019-08-16 at 1 54 32 PM

If the binding is being created, which it is, then I assume the subscriber is working. Any idea why that function never gets called?

I also see this:
Screen Shot 2019-08-16 at 2 19 53 PM
which I assume means that Rabbit is spamming the connection with delivery attempts, none of which are succeeding?

@mcblum
Copy link
Author

mcblum commented Aug 16, 2019

Apparently, I'm answering my own questions here :) I didn't realize those decorators couldn't be used in a controller, which is why the binding was working but the function was never being called. I've fixed that, but don't see in the docs how to handle the response from @RabbitRPC. With NestJS' default implementation you'd do .subscribe((res) => {}) but I don't see docs for that here. Am I misunderstanding how this works vs. Nest's default?

@mcblum mcblum changed the title Exchange bindings? Questions about implementation Aug 16, 2019
@mcblum
Copy link
Author

mcblum commented Aug 17, 2019

Once again, given enough time, apparently I learn how to read. Should anyone else struggle with this coming from NestJS' default implementation, make sure if you want a response to your message you use await this.amqp.request and not await this.amqp.publish

@mcblum mcblum closed this as completed Aug 17, 2019
@WonderPanda
Copy link
Collaborator

Hey @mcblum Sorry I didn't get back right away, I'm actually on vacation this week so haven't been keeping an eye on this. Thanks for checking out the library and I'm glad that you got things sorted out! Feel free to open issues if you do run into any issues or limitations with the current capabilities of the librar

@mcblum
Copy link
Author

mcblum commented Aug 18, 2019

@WonderPanda all good, no worries at all! It's so great - thank you for putting this together. It took a bit for me to stop doing dumb things, but eventually, I got everything working great. I made a small wrapper around the request method using observables and now everything is great.

Really appreciate your hard work on this, it's so awesome to be up and running!

@WonderPanda
Copy link
Collaborator

@mcblum That sounds awesome! Did you want to contribute the Observable wrapper back to the library? I can see that being something more people might be interested in. I'm happy to merge pull requests for good additions

@mcblum
Copy link
Author

mcblum commented Aug 19, 2019

@WonderPanda yeah dude, I'll do that!

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

2 participants