-
-
Notifications
You must be signed in to change notification settings - Fork 578
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
Problem with star wildcards and NATS #517
Comments
I can't reproduce it. Your code snippet is working properly:
|
Sorry, that snippet was a bit misleading. Let me clarify. This issue happens in integration tests and running live from docker-compose. I have not had any luck reproducing it in a unit test or running local. In fact it will pass all unit tests, which is where I was bitten. If you check out the repository I linked to, you should see what is going on better. As I have integration tests and the docker-compose setup to repo the issue. But if I was to create two services putting both into separate docker containers. One with an action that broadcasts an event. The other subscribed to all events ( If I subscribe to the event directly it will work. But the wildcards don't seem to. To further this strangeness; If I subscribe to |
Are you using |
yes |
Ok, the problem is because disableBalancer. So adding I will fix it. |
Sounds good, I was wondering if there was a better place for it than the match method. |
@icebob Thanks for fixing this for us. We were just wondering when you were planning your next release. |
I've just released 0.13.9 |
You are the best. Thanks |
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
Subscribing to ** event should capture all events emitted or broadcast from services over NATS transport
Current Behavior
** does not seem to catch anything
Failure Information
Events are not triggered for ** subscriptions when multiple services are dispatching events across NATS transportation
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Reproduce code snippet
Example ready to run
https://github.com/levia7han/moleculer-wildcard
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs
Background
Attempting to write a service that logs all events broadcast or emitted within the system. I noticed that although unit tests were working, when we tried to get integration tests and real life testing to work we were not seeing the events we expected in the logs.
After digging into the code it seems like there is an issue with moleculer using * as a wildcard character where NATS expects > as a wildcard.
I have a pull request that adds the > wildcard along with tests that seems to fix this issue. It is located at https://github.com/levia7han/moleculer/tree/nats-wildcard
The text was updated successfully, but these errors were encountered: