Repository navigation
Conversation
a1e7a03 to
0bbb6ef
Compare
Preserve extensions through binary AMQP encode/decode for both supported CloudEvents versions and correct the existing writer expectations. Fixes cloudevents#766 Signed-off-by: redyyang <3202137046@qq.com>
0bbb6ef to
b79dc19
Compare
|
@yangjj-iso this will be a change for current SDK users, correct? |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the AMQP extension-prefix alignment.
No open issues 🎉
What changed in this PR
Fixes #766 by aligning AMQP binary extension serialization with the reader’s expected cloudEvents: prefix, preventing extensions from disappearing during round trips.
Changes:
- Prefix fallback extension application-property names in the writer.
- Correct writer expectations and add Proton encode/decode round-trip tests for CloudEvents 0.3 and 1.0, without payloads to isolate this fix from #761.
| File | Description |
|---|---|
amqp/src/test/java/io/cloudevents/amqp/ProtonAmqpMessageWriterTest.java |
Updates prefix expectations and verifies tracing and custom extensions survive wire round trips. |
amqp/src/main/java/io/cloudevents/amqp/impl/ProtonAmqpMessageWriter.java |
Adds the cloudEvents: prefix to fallback extension property names. |
Review effort: Balanced
EmiRZx
left a comment
There was a problem hiding this comment.
tested a wire round trip through Proton and sdk-go. on main the writer emits bare custom and traceparent application properties, and neither the Java reader nor sdk-go reads them back. with this PR both get the extensions, and sdk-go already writes the same cloudEvents: names, which the Java reader accepts.
on duglin's question, yes, the property names on the wire change. SDK readers gain the extensions, while a consumer reading the bare traceparent property directly would need cloudEvents:traceparent. this merges cleanly with #757, #761 and #763, and the AMQP tests pass with all four once the test file conflict between #761 and #763 is resolved.
All 20 Proton message writer tests pass on the merged tree.
Fixes #766.
Binary AMQP messages currently serialize extensions as bare application-property names, while the reader only accepts
cloudEvents:-prefixed names. For example, atraceparentor custom extension disappears after a writer/Proton encode/decode/reader round trip.Prefix the fallback extension names in
ProtonAmqpMessageWriter, as required by the AMQP binding's primary mapping. Correct the existing writer expectations and add real wire round-trip coverage for CloudEvents 0.3 and 1.0, includingtraceparent,tracestate, and a custom extension. The tests use no payload to isolate this change from #761.Validation:
MAVEN_OPTS=-Xmx384m ./mvnw -B -ntp -pl amqp -am verify -Dmaxmemory=256mpassed with 136 tests (API 8, core 90, AMQP 38), plus all three modules' Javadocs.git diff --checkpassed. No live broker or full-repository integration suite was run.AI assistance was used to investigate, implement, and test this change.
Compatibility
This changes the wire property names for CloudEvents extensions in newly written binary AMQP messages. Consumers that inspect raw properties must read
cloudEvents:<name>after upgrading. CloudEvents readers that already follow the AMQP binding can then recover these extensions. Previously emitted bare properties are still treated as ordinary AMQP application properties. Standard attributes and structured-mode messages are unchanged.