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

Return HTTP OK Response after user logic execution #46

Merged
merged 1 commit into from
Jul 5, 2021

Conversation

LakshanSS
Copy link
Member

Purpose

Currently in the listener implementation, the moment we receive the event, we respond with status 200 OK, and then we dispatch the event. At user function implementation if there was an error we throw it up. In this case, as we have already responded with 200 OK, http client cannot convert the error and respond again, because it cannot respond to the same message twice.
Ideally we should respond with status 200 OK only after dispatching the event. At user function implementation if there was an error we throw it up & the http client will return status 500 error. If there is no any errors & the user logic is executed successfully, we should respond with status 200 OK.

Goals

  • Return HTTP OK Response after user logic execution

Security checks

Related PRs

#45

Test environment

JDK 11
Ballerina SLBeta2

@abeykoon abeykoon merged commit 004dc8f into ballerina-platform:master Jul 5, 2021
@LakshanSS LakshanSS deleted the laki-http-200-2 branch October 11, 2021 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants