Migrating from custom gateway API in dotnet 6 to YARP #2668
Unanswered
aswinfrancis91
asked this question in
Q&A
Replies: 1 comment 1 reply
-
After breaking my head over this for some time I found the problem to be Consumes and Produces attribute I had on controller :|
Update: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a dotnet 6 API project that acts as a gateway. This gateway project has controllers that accept the request and then send the request to our microservices via SDKs we have for them. I am now trying to implement YARP so that devs don't have to write code in our gateway whenever they have created a new endpoint in one of the microservices. However we have consumers for our existing endpoints in gateway and over last couple of months they are a bit of mess. There isn't a common convention for them. So I wrote a config as seen below
The problem I face is some that with this config some of the actions hit controllers in my project but some are being proxied. For example I have below two endpoints:
The second one hit my breakpoint in controller but the first one is proxied and forwarded to my microservice and fails as the endpoint isn't available. I see below log lines
The one that works logs this
What might be wrong here. Both controller have similar signature with route and action. I use serilog and added below config but I don't think i am seeing any logs related to YARP
Beta Was this translation helpful? Give feedback.
All reactions