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
Support setting custom Attributes on PubSub Messages #975
Comments
Briefly skimmed the code and it looks like it should work with Questions: @AndreasBergmeier6176 is my understanding of propagating CloudEvent extension attributes to @duglin I thought the SDK should not prefix (custom) extension attributes (I should be reading the code/SPEC but asking the expert here :) ) |
So after reading https://github.com/cloudevents/spec/blob/main/cloudevents/documented-extensions.md and looking at
|
all CE context attributes, including custom/extension attributes, are serialized like normal CE context attributes... so for HTTP they're prefixed with If so, the question for me then becomes: should the SDK user be expected to know how the attribute will be serialized and add the prefix, or should the SDK do it for them? Not all bindings add prefixes so it seems risky to for the user to do it themselves. Would it be possible to allow for people to add attributes and tell the SDK whether each is a CE one or not? E.g. pass in two lists instead of just one? Then the SDK, based on the binding/transport, can prefix the CE attributes if needed. |
Oh, sorry, this is just for Google pub/sub... is that limited to just http? |
I think from a clarity sense I would prefer to always know the serialization beforehand.
|
Can you elaborate what you mean by limited that limited to just http? |
Moving to the PR but I think this gets to the concern I have... |
It seems from #735 that currently the sdk has sole ownership of the
pubsub.Message
and lacks any means to set non-CloudEvents Attributes on PubSub Message when sending.There should be a way of sending custom Attributes (e.g.
content-encoding
:zstd
).The text was updated successfully, but these errors were encountered: