-
Notifications
You must be signed in to change notification settings - Fork 195
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
Using wildcards when publishing messages? #31
Comments
@JoseTomasTocino Postal does not currently support publishing to a wildcard. The wildcards allow you to subscribe to any number of topics being published, but the topics are expected to be specific: Subscription: Can you explain why you were wanting to use a wildcard in the publication? It might help me or @ifandelse understand so we can point you in the right direction. |
@dcneiner I was writing a blog post about postal.js (you can see it here). In the example I came up with, there's a However, reading your documentation more carefully I found out that I can replace the resolver with my own one that may accept using wildcards when publishing. |
@JoseTomasTocino I can understand why you might want to do something in your given blog post example, but I have not personally needed a wildcard publication in an actual application. But you found out how to accomplish it should you really need to! Glad to see you writing about publishing and that you are enjoying @elijahmanor 's blog series! He is a great guy! |
@JoseTomasTocino you can certainly implement your own resolver if you want, but I'd encourage you to rethink the need to publish a wildcard. The point of this kind of messaging is to allow subscribers to indicate the specific messages in which they are interested. By allowing the publisher to dictate which subscribers receive a message - instead of simply letting the subscribers handle that on their own via their subscriptions - you are introducing a subtle but eventually-dangerous form brittle-ness into your application that can be solved in a different (and better, IMO) way. If you need to publish a message indicating that all weather phenomena have stopped, I would make that it's own message. You can still have topics like |
Thanks for your comments guys! They've been really helpful. |
I know it's possible to use wildcards when referencing topic names in the suscriptions. However, it does not seem possible to use wildcards to target multiple topics when publishing messages.
Am I doing something wrong or is it simply not supported?
The text was updated successfully, but these errors were encountered: