apigeex with XLB routing logic with query parameter to apigee proxy

Hi 

We have a requirements where we want to set up routing rules in XLB to look at path paramter and convert it to query parameter and route to apigeex API proxy.

for ex:

consumer1 -> http://XLB:port/web/apiproxy

consumer2 -> http://XLB:port/mob/apiproxy

we need to set up XLB routing logic to look at web or mob and translate into query parameter in XLB and send to apiproxy.

so we are trying to achieve below in XLB.

http://XLB:port/apiproxy?client=mob

http://XLB:port/apiproxy?client=web

is this possible in apigee XLB?

Solved Solved
0 4 140
1 ACCEPTED SOLUTION

If you read the variable proxy.pathsuffix , you will have that remaining path. The documented context variables are described here.

View solution in original post

4 REPLIES 4


@selvagee wrote:

we need to set up XLB routing logic to look at web or mob and translate into query parameter in XLB and send to apiproxy.


WHY do you NEED to do that? What is the real goal here? What are we solving for? The way you've described it, this sounds like, Not a hard requirement, but a technical approach you are considering and exploring, in order to accomplish some other goal. What's your response to this?

With the External Load Balancer, you can route requests based on URL path (See the URL map feature). But as far as I am aware, you cannot configure the Load balancer to also modify the request while routing it. Which gets me to the WHY question I stated above.

You can configure the XLB to rewrite the URL path - to prepend a prefix to the path depending on the inbound path. That would allow you to configure something like this:

request # initial inbound URL Rewritten to
1 https://XLB:port/web/resource https://internalIP/router/web/resource
2 https://XLB:port/mob/resource https://internalIP/router/mob/resource

And you can configure an API proxy in Apigee to listen on the /router basepath, and then do... whatever it needs to do based on the value of that 2nd path segment, either "web" or "mob".  If you want that router proxy to convert the 2nd path segment to a query param, and then proxy that call to some other Apigee API proxy, you can do that pretty easily in Apigee. 

Thank you very much. I really appreciate it.

how do we get remaining path of /mob/resource or web/resource from https://internalIP/... in /router apiproxy please?

is there any scripting logic to extract remaining path from /router apiproxy?

If you read the variable proxy.pathsuffix , you will have that remaining path. The documented context variables are described here.

Thank you Sir.