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

Not Really An Issue, but needed assistance with a particular requirements #4

Open
jobas2007 opened this issue Feb 26, 2023 · 1 comment

Comments

@jobas2007
Copy link

Hi Again, this is not really an issue, but seeking help. Thought of using this as a channel for the same. Apologies if used incorrect means.

I created a sample project under (NOTE: Just sample projects , feel free to modify)

https://github.com/jobas2007/spring-cloud-gateway-demo (runs on 9000)
https://github.com/jobas2007/book-service (destination with 2 services running on 9001/9002)

Basically, gateway demo project has a listener that consumes JSON msg from kafka topic , and then finally POST/route to either "walmart book service" OR "target book service" (based on customer in mgs).


Sample Msg On Topic:
{

"title" : "Lord of the rings",
"author" : "Will Miller",
"customer":  "walmart"

}


Because i am trying to use a single app as consumer, for POST to gateway routes, with Feign as a sudo client (tried with other reactive clients as well), the route configuration is yet to work properly.

Appreciate any assistance in fixing the route. If that is fixed, next step would be to

  1. secure book services with their respective OAuth2 and then add filters in gateway to call with token
  2. Add 3rd and more book services with other security mechanisms (like Basic Auth, API keys etc), and have corresponding routes to support.

Appreciate any help/assistance.

@jobas2007
Copy link
Author

Update: I was able to finally make it work (github repos updated) by fixing routes, but still doubtful of approach. Basically unsure if the workaround of creating a pseudo POST in feign client (POST to itself) in same app is correct use, as responsibilities appears to be blurred (where gateway and consumer are relying on pseudo bridge of feign client). Looking for better alternatives.

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

No branches or pull requests

1 participant