I want to share a learning I got while designing API Resource modal.
Proxy1 :
Basepath :
/abc/def
Resource url:
/xyz/mno
Testing url:
/abc/def/xyz/mno
===========================
Proxy2:
Basepath:
/abc/def/xyz
Resource url:
/ijk
Testing url:
/abc/def/xyz/ijk
Now the two proxies deploy because both having two different basepaths.
But there will be a conflict while testing.
When testing first url,
/abc/def/xyz/mno --->It will match maximum against an existing basepath.
So,this will match with proxy2 basepath:
{/abc/def/xyz} --basepath
/mno - Unknown resource.as the expected one is /ijk
So,design basepath+resourcepath in such a way that it does not match with any other proxy url as in above scenario.
Something else is at play in your configuration. Our classification engine works from most specific to least specific such that the routing you desired should work.
Consider two bundles:
A request to http://davidwallen2014-test.apigee.net/abc/def/xyz/mno is serviced by Proxy2. Examine this payload and note the value of pathsuffix.
A request to http://davidwallen2014-test.apigee.net/abc/def/ijk is serviced by Proxy1.
A request to http://davidwallen2014-test.apigee.net/abc/def/xyz/ijk is serviced by Proxy2 given that the most specific match includes the third term.
Note a conditional such as:
<Condition>(proxy.pathsuffix MatchesPath "/xyz/mno")</Condition>
will not evaluate to true as the /xyz segment is not part of the path suffix rather it is part of the base path. I think that is where your problem likely came in. A match on "/mno" would evaluate to true.
You also have the option of writing your conditions against the entire path as in:
<Condition>(request.path MatchesPath "**/xyz/mno")</Condition>
This example would match any path ending in /xyz/mno.
To summarize, overlapping base paths are allowed with the most specific path being the one used to route to a particular bundle. When executing conditional matching in flows you have the option of matching against any of the path related variables (really against any available variable).
The examples above are live to demonstrate behavior.
Thanks @Dallen for providing more information on this...I will verify the configuration with request.path.
I verified...
My configuration is little bit different from the one you said I guess..
Mine is as below,
Proxy1 basepath : /abc/def
Resource path :/xyz/ijk
Proxy2 basepath:/abc/def/xyz
Resource path : /pqr
Proxy2's basepath overlaps with Proxy1 basepath+Resourcepath partially.(position of /xyz)
Due to this,even when I want to hit proxy1 as /abc/def/xyz/ijk ,it matches the maximum path proxy2 - /abc/def/xyz.And finally throws unknown resource because of /ijk as the expected resource is /prq.