Open qrli opened 7 years ago
Use this https://github.com/Azure/service-fabric-aspnetcore/pull/7
WebHostBuilder()
// other config
.UseServiceFabricIntegration(listener, ServiceFabricIntegrationOptions.UseReverseProxyIntegration)
@Mardoxx Thanks for the pointer. Great info. However, that's exactly what I want to avoid. In fact I have wrote my own middleware. (the implementation your mentioned is better than mine though :+1: ) I still have to make sure every microservice uses it correctly. And we also have Node.js microservices, which uses a different middleware.
I'd like to avoid the cross-cutting concerns to spread across all microservices. I'd like to shorten the checklist for every new microservice.
@qrli Yup, makes sense, it's something we're working on, specifically decoupling services from each other and from networking concerns in general.
@qrli Yup, makes sense, it's something we're working on, specifically decoupling services from each other and from networking concerns in general.
No news about it? Even if I agree with @qrli and @Mardoxx the real pain here is when the Stateless Service is an existing web api application developed without the ServiceFabric SDK, I mean a java spring boot rest api or a node rest api for example. For all of them we need to find a weird way to inject a web filter to intercept all the returning response and adding the "X-ServiceFabric" "ResourceNotFound" response header before commit the original response.
With ASP.NET Core, we are using Kestrel exclusively. However, the assumption of port sharing by reverse proxy requires every microservice to add extra header
X-ServiceFabric : ResourceNotFound
. This is not microservice friendly, and we are caught every so often.I propose an option/setting to switch the default behavior.