Extension of Quarkus example with structured content mode
@matejvasek ci sta già lavorando.
Dal 19/7/2022.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
I like the Quarkus example.
However, it seems to use the Binary Content Mode. I however require the Structured Content Mode. Initially I did not even notice that the binary mode left out the metadata from the body. I did not even notice initially there were 2 modes.
It took me quite some time that all that's required is adding the annotation @Consumes( JsonFormat.CONTENT_TYPE ) to the client:
@Path( "/notify" )
@RegisterRestClient
public interface BrokerClient {
@POST
@Consumes( JsonFormat.CONTENT_TYPE )
void emit( CloudEvent event);
}
Will trigger sending the request in the Structured Content Mode.
Likewise adding a @Consumes( JsonFormat.CONTENT_TYPE ) to the server:
@POST
@Path( "notify" )
@Consumes( JsonFormat.CONTENT_TYPE )
public Response create( CloudEvent event ) {
// logic
}
Fixes the server part. All the more confusing is that this reference mentions the Quarkus example (while discussing the structured content mode).
Suggestion: update the README.md or extend the example.
- Lingua principale
- Java
- Stelle
- 446
- Fork
- 172
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudevents/sdk-java
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudevents/sdk-java#731 · 1 reazione ·
-
bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
cloudevents/sdk-java#697 · 3 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudevents/sdk-java#689 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
cloudevents/sdk-java#660 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
cloudevents/sdk-java#748 ·
Tutte le issue di cloudevents/sdk-java
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenAPITools/openapi-generator#25014 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
AloisSeckar/demos-java#380 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openhab/openhab-core#5847 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
appsmithorg/appsmith#42297 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100