When adding a extension to a builder it is not being serialized to the message
See original GitHub issueWhen building a cloudEvent like below :
final DistributedTracingExtension dte = new DistributedTracingExtension();
dte.setTraceparent("00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01");
dte.setTracestate("congo=BleGNlZWRzIHRohbCBwbGVhc3VyZS4");
return new
CloudEventBuilder<T>().contentType(ContentType.APPLICATION_JSON.getMimeType())
.id("123")
.time(ZonedDateTime.ofInstant(Instant.now(), ZoneOffset.UTC))
.type("evType")
.source("a.b.c")
.data(entity)
.extension(dte).build();
The extension is not being serialized when creating the json event.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:5
Top Results From Across the Web
Serializing with Jackson (JSON) - getting "No serializer found"?
I solved it by adding this annotation for my child class whose object was to be serialized. @JsonAutoDetect(fieldVisibility = JsonAutoDetect ...
Read more >Writing Your Own Extension - Quarkus
Quarkus extensions add a new developer focused behavior to the core offering, and consist of two distinct parts, buildtime augmentation and runtime ...
Read more >Overview | Protocol Buffers - Google Developers
A map type, to add key-value pairs to your definition. In proto2, messages can allow extensions to define fields outside of the message,...
Read more >Use MessagePack Hub Protocol in SignalR for ASP.NET Core
Adding MessagePack enables support for both JSON and MessagePack clients. ... Kind is not preserved when serializing/deserializing.
Read more >Different Serialization Approaches for Java - Baeldung
There are some caveats that concern native serialization in Java: Only objects marked Serializable can be persisted. The Object class does not ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any news on this? We need the extensions as well.
We have found an easy workaround for this. So instead of doing this:
we do this:
For some reason the latter results in a string which has extensions serialized in one of the resulting json fields