Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive Rest Client + CloudEvents shenanigans #30596

Closed
manuelserradev opened this issue Jan 25, 2023 · 3 comments
Closed

Reactive Rest Client + CloudEvents shenanigans #30596

manuelserradev opened this issue Jan 25, 2023 · 3 comments
Labels
area/rest-client kind/question Further information is requested

Comments

@manuelserradev
Copy link

Describe the bug

I'm opening this issue in correlation with the sibling one here on the cloudevents repo.

Apparently using the reactive rest client in conjunction with cloudevents inhibits the correct headers and content negotiation when trying to dispatch "structured encoded" events with the following annotation:

@POST
@Consumes(JsonFormat.CONTENT_TYPE)
Response publishCloudEvent(@PathParam("channel") String channel, CloudEvent cloudEvent);

I'm opening this issue because using quarkus-rest-client-jackson instead of the suggested quarkus-rest-client-reactive-jackson results in a correct behavior.

Expected behavior

The rest client dispatch "structured encoded" cloudevents. See here for the detailed spec.

Eg, an HTTP POST with the following body payload:

{
    "specversion" : "1.0",
    "type" : "User",
    "source": "io.cloudevents.examples/user",
    "id": "536808d3-88be-4077-9d7a-a3f162705f78",
    "subject": "SUBJ-0001",
    "data" : {
        "username": "jsmith",
        "firstName": "John",
        "lastName": "Smith",
        "age": 37
    }
}

Actual behavior

The rest client always dispatch "binary encoded" cloudevents. Ignoring the @Consumes annotation. See here for the detailed spec.

Eg. an HTTP POST with the following body payload:

{
  "username": "jsmith",
  "firstName": "John",
  "lastName": "Smith",
  "age": 37
}

How to Reproduce?

See this repo.

TL;DR:

Output of uname -a or ver

Linux kunta-dell 5.15.79.1-microsoft-standard-WSL2 #1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17" 2021-09-14 OpenJDK Runtime Environment Microsoft-26987 (build 17+35) OpenJDK 64-Bit Server VM Microsoft-26987 (build 17+35, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.15.3.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6

Additional information

No response

@manuelserradev manuelserradev added the kind/bug Something isn't working label Jan 25, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 25, 2023

/cc @Sgitario (rest-client), @cescoffier (rest-client), @geoand (rest-client)

@manuelserradev
Copy link
Author

I'm closing this issue after verifying that removing a third-party dependency results in a correct behavior. See here.

@geoand geoand added kind/question Further information is requested and removed kind/bug Something isn't working labels Jan 25, 2023
@geoand
Copy link
Contributor

geoand commented Jan 25, 2023

Thanks for the update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest-client kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants