-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Tags for Publish #87
Comments
Hello @shaunco Yes, at this point tags can only be attached to Publication using server API. Centrifugo model is mostly built around using server API for publishing (as you can find here). Also, while technically possible, I am not sure that we want tags in client API because it will mean more possible fields for backend to validate before accepting a publication. |
Thanks @FZambia! I think my confusion arises from not seeing another go library for use between the Since my particular usecase is sending protobuf payloads, I will just embed the additional fields I was thinking of putting into |
To expand on that further, there are many pub/sub use cases where there is no need to "validate before accepting a publication" - simply holding a valid token usable by Centrifugo is enough validation. The two examples that come to mind are:
Neither case has the concept of an untrusted client that needs a different API or to have its publications validated before going to Centrifugo, but from an SDK standpoint, centrifuge-go appears to be the best (and only) option for a go package. I understand that gRPC can be used directly (as shown here) the generated gRPC client is missing things like auto-reconnect (with exponential backoff), auto-resubscribe, auto-recovery, and more that makes it fine when an Am I missing something here? |
All the thoughts are totally valid, some things I can add:
So before adding Tags to client API in some way, I suppose it's required to think how to add them to current permission model, probably we can make propagating tags explicit somehow - so backend does not have a chance to forget about tags field and propagate them without validation. So let's think more whether it's possible, and keep this issue open. It's not a quick addition, so probably for now you need to use alternative way with adding information to data payload or using server API client. |
Thanks! I had missed gocent. Happy to move this from an Issue to a Discussion, or keep it here, but I appreciate the openness to thinking about IoT use cases! We have a dedicated |
When
OnPublished
is called for a message received on a subscribed channel, thePublication
struct has aTags
member which matches up withtags
as described on https://centrifugal.dev/docs/transports/client_api ("optional tags, this is a map with string keys and string values"), however whenclient.Publish
orsubscription.Publish
is called, there is no field allowing fortags
to be added.Am I misunderstanding the client API vs the server API? Can tags only be specified on the server side?
The text was updated successfully, but these errors were encountered: