-
Notifications
You must be signed in to change notification settings - Fork 1
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
feature (template/server): Provide a server side application template for webhooks #10
Conversation
Overall, this is really good stuff. What are your thoughts on how the snippets will be slotted in? Will the snippet file just be able to replace the business logic file, like the way the client app works? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion of class naming: ParsedEventHandler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to our last discussion, ServerBusinessLogic
will be used
…e classes processing webhooks business logic
NumberEvent event = webhooks.parseEvent(body); | ||
|
||
// let business layer process the request | ||
webhooksBusinessLogic.numbersEvent(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although thanks to the Spring Boot configuration (typically the @ResponseBody
annotation included with @RestController
) and the method returning void
, this will return an empty body with a status 200 (which is expected), it might be clearer to explicitly a ResponseEntity
to make the intended behavior clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good [educational] idea 👍
Applied to all controllers
WebHooksService webhooks = sinchClient.numbers().v1().webhooks(); | ||
|
||
// decode the request payload | ||
NumberEvent event = webhooks.parseEvent(body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, the incoming request should be verified before being processed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right.
Created a ticket to add this missing feature to webhooks service
Thank you to highlight this
com: INFO | ||
|
||
server: | ||
port: 8080 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the same value as in the README file (8090)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
PR based onto Numbers related one because of using Numbers versioned V1; but have to be merged after Numbers to main