cloudevents / cloudevents/sdk-java
[restful-ws] Allow configuring default writer encoding for CloudEventsProvider
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 446
- Forks
- 172
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
The CloudEventsProvider defaults to binary encoding. Only when there is an StructuredEncoding annotation present, this mode will be set. See the logic:
This makes the BinaryEncoding useless, confirmed by no usages in the code.
The default to the binary mode is unfortunate. Some implementations like Quarkus RESTEasy Reactive Server Sent Events (SSE) don't provide the annotations. This is problematic, as the binary mode doesn't make sense in SSE - the headers set by CloudEventsProvider are being dropped.
See the code:
See repro: https://github.com/cardil/openshift-knative-showcase/commit/15e00429c459abf655fb483a27f467d598ae173e
Related issue: https://github.com/quarkusio/quarkus/issues/31559
The fact the Quarkus doesn't pass the method annotations, is probably a bug in Quarkus. But, I feel the CloudEvents SDK should allow setting the default mode. Then, the BinaryEncoding could have a meaning, of changing that default encoding per-method.
/kind bug
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in http/restful-ws/src/main/java/io/cloudevents/http/restful/ws/CloudEventsProvider.java, insbesondere mit der Logik rund um die Zeilen 95–112, und überprüfe das verknüpfte Quarkus-SSE-Verhalten. Ermittle, wie eine konfigurierbare Standardkodierung mit den Annotationen StructuredEncoding und BinaryEncoding interagieren sollte. Die Aufgabe ist erledigt, wenn Aufrufer den Standardmodus auswählen können und das Kodierungsverhalten pro Methode weiterhin sinnvoll bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100