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

Http Binding returning wrong status code #1127

Closed
rochabr opened this issue Sep 17, 2024 · 1 comment · Fixed by #1130
Closed

Http Binding returning wrong status code #1127

rochabr opened this issue Sep 17, 2024 · 1 comment · Fixed by #1130
Assignees
Labels
kind/bug Something isn't working P0
Milestone

Comments

@rochabr
Copy link

rochabr commented Sep 17, 2024

Actual Behavior

Upgrading the Java Dapr SDK from 1.11 to 1.12 changed the exception handling behaviour in Http Binding where the errorIfNot2XX flag is set to false.

ie: When service A calls service B and B throws an error:

Dapr SDK 1.11
A gets the error status code (eg 400) and the error response body.

image

Dapr SDK 1.12
A gets the status code (eg 405) as part of the response body itself and overall http request status is 200.

image

They are mentioning that they now need to parse the response body manually in order to evaluate whether the call fetched a successful response or an exception.
Here is the code:

Map<String, String> requestMetaData = new HashMap<>();
requestMetaData.put("errorIfNot2XX", "false");

daprClient.invokeBinding(
        "fetch-documents-using-group-name",
        DaprHttpMethod.POST,
        body,
        requestMetaData,
        Void.class);
mono.block();

Is this a bug or was this change planned? This is likely due to the way the change in the java sdk returning status object and not httpStatusCode .

@rochabr rochabr added the kind/bug Something isn't working label Sep 17, 2024
@artursouza artursouza self-assigned this Sep 17, 2024
@artursouza artursouza added the P0 label Sep 17, 2024
@artursouza artursouza added this to the v1.12 milestone Sep 17, 2024
@artursouza
Copy link
Member

The change to make this work was not added to master branch after 1.11, so it was not added to 1.12. I am working to porting this change over, just need to re-do some of it given all the code conflicts. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working P0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants