Handle Structured CloudEvent binary payload convertion - #1460
Open
radhakrishnan10192 wants to merge 1 commit into
Open
Handle Structured CloudEvent binary payload convertion#1460radhakrishnan10192 wants to merge 1 commit into
radhakrishnan10192 wants to merge 1 commit into
Conversation
Signed-off-by: radhakrishnan <radhakrishnan@paypal.com>
radhakrishnan10192
force-pushed
the
bugfix/cloud-event-structured-flow
branch
from
September 3, 2026 06:00
f35f402 to
c489503
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1455
Problem
When a structured-mode CloudEvent (Content-Type: application/cloudevents+json, whole envelope in the body) is consumed by a function whose target type is the CNCF
io.cloudevents.CloudEvent, conversion fails.
CloudEventMessageUtils.toCanonical(...) transforms the structured message into a binary-shaped message (data extracted into the payload, attributes moved to ce-* headers), but
the resulting message is left in an inconsistent state:
Downstream, io.cloudevents.spring.messaging.CloudEventMessageConverter re-decides structured-vs-binary purely from contentType. Because the stale application/cloudevents+json
remains, it selects the structured reader and tries to re-parse the already-extracted payload as the envelope:
This only affects the io.cloudevents.CloudEvent target type. A plain POJO target works because Spring's own converters can bind a Map payload to a POJO, which is why the existing tests didn't catch it.