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

Wildcard support for Redis subscriptions in microservices #10344

Closed
1 task done
tijsmoree opened this issue Oct 3, 2022 · 2 comments · Fixed by #10359
Closed
1 task done

Wildcard support for Redis subscriptions in microservices #10344

tijsmoree opened this issue Oct 3, 2022 · 2 comments · Fixed by #10359
Labels
needs triage This issue has not been looked into type: enhancement 🐺

Comments

@tijsmoree
Copy link
Contributor

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

When creating a Redis microservice, it is not possible to make use of wildcards in the pattern/topic (like it is for MQTT for example). This however is supported by the npm packages 'redis' and 'ioredis' by using psubscribe instead of the simpler subscribe.

(Another issue with the same request (#5211) was closed, but I do believe it to be a good feature.)

Describe the solution you'd like

Start using psubscribe instead of subscribe in the source code of the Redis microservice. This makes sure it is possible to use wildcards in the pattern/topic.

I cannot think of any drawbacks, because it simply is an extra feature and the documentation of Redis itself specifies that there is no speed difference. The time complexity of either function is the same.

Teachability, documentation, adoption, migration strategy

The docs of the MQTT microservice already include an extra section for the wildcards explicitly. A similar one could be included for the Redis page, where the specifics on the wildcards would have to be changed. The reader could also be redirected to the Redis website for those details (https://redis.io/commands/psubscribe/).

What is the motivation / use case for changing the behavior?

I think it is a nice feature to make the Redis microservice more complete and useful and I cannot think of any drawbacks.

@tijsmoree tijsmoree added needs triage This issue has not been looked into type: enhancement 🐺 labels Oct 3, 2022
@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

tijsmoree added a commit to tijsmoree/nest that referenced this issue Oct 4, 2022
The redis microservice now makes use of `psubscribe` and `pmessage`,
which makes it possible to use wildcards as specified by the Redis
documentation.

Closes nestjs#10344
tijsmoree added a commit to tijsmoree/nest that referenced this issue Oct 11, 2022
The redis microservice now makes use of `psubscribe` and `pmessage`
when the `wildcards` option is enabled in the options of the microservice,
which makes it possible to use wildcards as specified by the Redis
documentation.

Closes nestjs#10344
@kamilmysliwiec
Copy link
Member

Let's track this here #10359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into type: enhancement 🐺
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants