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

Forwarding OPTIONAL attributes #461

Merged
merged 4 commits into from
Jun 26, 2019
Merged

Forwarding OPTIONAL attributes #461

merged 4 commits into from
Jun 26, 2019

Conversation

deissnerk
Copy link
Contributor

Addresses issue #290.

spec.md Outdated Show resolved Hide resolved
@duglin
Copy link
Collaborator

duglin commented Jun 18, 2019

@deissnerk I think the CI issues are real

@duglin duglin added the v1.0 label Jun 18, 2019
@clemensv
Copy link
Contributor

Good clarification, LGTM

Copy link
Contributor

@cneijenhuis cneijenhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for clarifying this!

spec.md Outdated
include that feature in a message if it wants, and a consumer can choose to
support that feature if it wants. A consumer that does not support that feature
will then silently ignore that part of the message. The producer needs to be
prepared for the situation where a consumer ignores that feature. For an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn't part of your PR, but I'm struggling with what this sentence is trying to say.

The producer should be loosely coupled from the consumer anyway. That makes the producer always prepared for the consumer ignoring parts of the message (whether OPTIONAL or not) or the whole message, doesn't it? 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you already said, I didn't write this. 😃
Could it mean that without the OPTIONAL attribute the consumer would interpret the event differently?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally that kind of language is important when the specs have a processing model associated with it. In those cases a REQUIRED property typically can not be ignored by the receiver if they want to be compliant with the spec because there's some processing rules associated with it. While an OPTIONAL property can be ignored, which means the sender needs to be prepared for that.

In our case, we don't have anything as strong as a processing model that people need to adhere to, but I do think people need to be prepared for cases such as when they add "partionkey" to events and assume that means the receiver will put all incoming events into the same partition, but in fact that may not happen. The receiver can completely ignore it.

spec.md Outdated
will then silently ignore that part of the message. The producer needs to be
prepared for the situation where a consumer ignores that feature. For an
[Intermediary](#intermediary) silently ignoring OPTIONAL attributes means that
it MUST forward them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling with "silently" ignoring (also above). How would a one (consumer or intermediary) "loudly" ignore an attribute? If the intermediary "loudly" ignores the attribute, then the MUST doesn't apply?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal:

An Intermediary MUST forward OPTIONAL attributes.

or, less strict:

An Intermediary MUST forward OPTIONAL attributes, unless explicitly configured to ignore them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, loudly ignoring to me usually means that it logs messages starting with "WARNING" or "ERROR" which then might cause some indicator on an operator's dashboard show a red or yellow light. 😀
I would also be open to your less strict proposal, because that is what I had in mind. I don't think you can foresee all use cases for intermediaries. Perhaps there will be use cases where intermediaries are used to filter out certain attributes. Basically, I wanted to express that an intermediary should only drop an attribute, if it is INTENTIONALLY, but using the word intention in combination with a piece of software seemed strange. 😉

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL "loudly ignore" - clearly it's been a while since you've gotten the 'silent treatment' !

Same as @deissnerk, to me "silently ignore" it means they shouldn't do something like reject the request because of it.

I'm kind of wondering what "explicitly configured" means though... does this mean that if someone "explicitly configures" a consumer to ignore (not forward) all optional attributes they're ok?

For reference, RFC2068 says this:


The extension-header mechanism allows additional entity-header fields
to be defined without changing the protocol, but these fields cannot
be assumed to be recognizable by the recipient. Unrecognized header
fields SHOULD be ignored by the recipient and forwarded by proxies.

and

Hop-by-hop headers, which are meaningful only for a single
transport-level connection, and are not stored by caches or
forwarded by proxies.


I think the use of "unless explicitly configured" is a potentially confusing way of saying SHOULD or STRONGLY RECOMMENDED, so I would prefer to avoid any potential confusion and just use one of those instead of MUST.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@duglin I liked the notion of silently ignoring, because it suggests that if an intermediary does not know what to do with it, it MUST just pass it on. In the end it boils down to "pass it on, unless you know exactly what you are doing". So your proposal is fine to me, as well.
The example with the hop-by-hop headers is interesting. When we were still discussing property bags, @clemensv was proposing something similar to the AMQP message annotations for this. In the AMQP spec you find:

The message-annotations section is used for properties of the message which are aimed at the infrastructure and SHOULD be propagated across every delivery step. Message annotations convey information about the message. Intermediaries MUST propagate the annotations unless the annotations are explicitly augmented or modified

So there the term explicitly is used.

@duglin
Copy link
Collaborator

duglin commented Jun 20, 2019

Approved on the 6/20 call - but use SHOULD in there instead of MUST

@deissnerk let me know when it's ready and I'll merge it

@duglin
Copy link
Collaborator

duglin commented Jun 25, 2019

LGTM
Per last week's call we agreed to this change, but can I get one more LGTM and then I'll merge it?

@cneijenhuis
Copy link
Contributor

LGTM 👍

@duglin
Copy link
Collaborator

duglin commented Jun 26, 2019

@cneijenhuis thanks. merging per approval on last week's call.

@duglin duglin merged commit a19b3f3 into cloudevents:master Jun 26, 2019
@deissnerk deissnerk deleted the issue290 branch October 2, 2019 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants