-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Add manual routes support to imperative gateway #25817
Conversation
I'm guessing there's no way to halt the generation of all apps when this error occurs:
I ran the following command and got distracted:
When I came back to my terminal, I was confused as to why the |
I tried the JDL in #25715 (comment) and was confused at first that there was no Consul Docker image to start up. Then I realized there was no service discovery so it's not needed. Should we issue a warning when there's a Related: If I run
|
Indeed it works with serviceDiscovery enabled. |
@mshima I tried changing the JDL from 25817.mp4 |
generators/server/templates/src/main/resources/config/application.yml.ejs
Outdated
Show resolved
Hide resolved
clientFramework angular | ||
creationTimestamp 1617901618886 | ||
databaseType mongodb | ||
jhiPrefix custom | ||
jwtSecretKey "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=" | ||
messageBroker kafka | ||
packageName com.okta.developer.gateway | ||
serviceDiscoveryType consul | ||
reactive false | ||
serviceDiscoveryType no |
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.
Gateway shouldn't be an option for microservice architecture, there's no point specifically routing.
I'm strongly against adding an antipattern just to please users that aren't able to achieve reactive programming from api to ms webclient.
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.
I agree that hard-coding routes in the gateway might not be a good idea. The reason we're considering it is that Spring Cloud Gateway MVC won't have support for service discovery until November 2024.
As far as reactive vs MVC, there does seem to be a demand for Spring Cloud Gateway MVC, that's why Spencer Gibb and the Spring Cloud team are working on it.
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.
I don't agree.
- it's not up to us to say
you should use service discovery for every gateway/microservice use case
- we do not forbid gateways and microservices without serviceDiscovery
- Add
manual
option for service discovery #21012 is open for more than a year without any comment
IMO we have do choose one of:
- accept manual routes PR
- force the user to use
--skip-checks
for gateways and microservices without serviceDiscovery and close Addmanual
option for service discovery #21012
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.
It's just IMHO:
Backend Gateways:
- Act as a single point of entry of frontend request
- Is in charge of managing permissions (users and authorities)
- Route requests to the according microservice by querying the registry and translating exceptions and return codes
- Retry, circuitbreaking policy, ...
And this is simple enough to be managed by reactive paradigm to anyone (imperative would also please me as I find reactive quite hard, but still)
Otherwise, we loose one of the 12 factors and microservice paradigm. Manual route is not hipsterish and definitely not something worth the maintenance, I would personally prefer to close the #21012 as antipattern
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 BTW, this paradigm should also be applied for microfrontend too ;-)
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.
To add to this discussion, here's a video from Josh Long about why Spring Cloud Gateway MVC. Summary: because Java 21 with virtual threads and it's easier to understand. https://youtu.be/1ouE2QAebuE?si=-603Akrcvgn0HiMN&t=244
f8cebf2
to
cf9d21b
Compare
Related to #25715
Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (below reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.