-
We're looking at using Ocelot as a frontend to our services, but one of the things we'd like to be able to do is to take take over the request at some point if it matches certain criteria. We need to do this to support data residency for our services. If a user's data location is set as some other country, then we need to be able to proxy the request to that country instead. In addition to where the user is located, we also sometimes need to proxy a request to a region where the content itself is stored in (when it's not in the same location as the user's data should be). For this we'd want to be able to pull route parameters from the request and use those to fetch information about the content. We could do middleware before Ocelot even runs (and only use Ocelot for users that have their data stored in the country that the cluster is running in), but I'd love to integrate it more with Ocelot if possible. I guess the other way of doing this would be to have a custom implementation of the part that gets the downstream route, but that also looks like it's too early in the pipe. Would something like this be recommend with Ocelot? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@yuft Yeah, that's what we're using right now actually and it's pretty good. Just a little more entangled with our services than we want it to be. |
Beta Was this translation helpful? Give feedback.
-
@Tadimsky Hi Jonno!
If you need a bit more functionality than simple routing like: transforms, data conversions, integrations, analysis... then our Delegating Handler feature will help you. Finally, I'd say that development of a custom middleware will be an overhead approach. So, delegating handler works fine in your user scenario. |
Beta Was this translation helpful? Give feedback.
@Tadimsky Hi Jonno!
Welcome to the Ocelot world! 🐯
If you need a bit more functionality than simple routing like: transforms, data conversions, integrations, analysis... then our Delegating Handler feature will help you.
So, you need to develop custom delegating handler with required functionality. So, integrate your lovely Location Lookup service to a custom delegating handler.
Finally, I'd say that development of a custom middleware will be an overhead approach. So, delegating handler works fine in your…