Closed shurik239 closed 8 years ago
d'oh! that done
call shouldn't be there. replies have an automatic ack()
called on them...
of course, now that is say that i think this should not be the case. there should be a fn(message, actions)
signature on the callback so you can decide what to do with the reply.
for the duplicate first callback
problem, i'm looking into it now. will let you know what i find.
i duplicated the issue with a new test, sending two requests through the same object instance. as you show in your example, the first callback for the response handler is the only one being used. i'll have to dig into this further to figure out what the issue is and see what i can do to fix it
I think I found the problem in the way I'm using middleware. still investigating, and will hopefully have a fix in a day or two, depending on when i can get back to this.
i opened a ticket with the middleware project to see if they can add a feature to help me solve this problem: https://github.com/alessioalex/generic-middleware/issues/14
Thank you very much, Derick, for rapid response/investigation on this issue.
If we are speeking about reply/callback approach, i would suggest a feature request: If I understand it right, you send-receive pattern from Rabbus implements Command Messaging pattern from your book "RabbitMQ: Patterns for Application" (BTW, excelent work, thank you). It would be nice, if command consumer (receiver in Rabbus) could alsosay to producer, that the work is done.
@shurik239 can you open the feature request as a new issue? I don't want to get the issue in this one confused with that conversation
FWIW, I have a working solution in the "middlewareBuilder" branch. it's not really the best way to do things, yet, so i'm not quite ready for a release. I need to try one more idea based on discussion with @alessioalex in the linked ticket from his generic-middleware project. hopefully i'll get this fixed and done tonight. there's one other change I want to make before another release, as well. should be done and released on Wednesday, sometime (Feb 3rd).
Great! Thank you!
fixed in v0.7.1
The following code:
will result:
plus error in docs:
done is undefined