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

[Kafka spec] Conflicting sentences in message mapping #812

Closed
slinkydeveloper opened this issue Apr 19, 2021 · 3 comments
Closed

[Kafka spec] Conflicting sentences in message mapping #812

slinkydeveloper opened this issue Apr 19, 2021 · 3 comments

Comments

@slinkydeveloper
Copy link
Member

In message mapping paragraph we have 2 sentences:

The receiver of the event can distinguish between the two content modes by inspecting the content-type Header of the Kafka message. If the header is present and its value is prefixed with the CloudEvents media type application/cloudevents, indicating the use of a known event format, the receiver uses structured mode, otherwise it defaults to binary mode.

My interpretation is the following:

if content type is present and value is prefixed with application/cloudevent {
  structured
} else {
  binary
}

This logic is the same as every other protocol binding spec we have. But then, a couple of lines below, we have this sentence:

If the content-type header is not present then the receiver uses structured mode with the JSON event format.

This is in contrast with the above sentence, because if the content type is not present, following the above pseudocode, i should fall in the second branch.

I suspect this second sentence was placed to make the behaviour more kafkesque, because in kafka the content-type of a topic is usually known at-priory and using content-type header is not really kafka-idiomatic

slinkydeveloper added a commit to slinkydeveloper/spec that referenced this issue Apr 19, 2021
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
slinkydeveloper added a commit to slinkydeveloper/spec that referenced this issue Apr 19, 2021
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@slinkydeveloper
Copy link
Member Author

slinkydeveloper commented Apr 19, 2021

Proposals to fix (we should accept one of the two):

In theory both proposals are breaking in the spec sense, but I'm not aware of any (sdk) implementing the actual spec text properly, but rather they all implement the #813 behaviour.

@slinkydeveloper
Copy link
Member Author

@duglin can we close this one?

slinkydeveloper added a commit to slinkydeveloper/spec that referenced this issue May 17, 2021
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

(cherry picked from commit ca5bc52)
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@duglin
Copy link
Collaborator

duglin commented Jun 10, 2021

ok looks like we can close this one since #813 was merged. Let me know if I'm mistaken

@duglin duglin closed this as completed Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants