Layer7 API Management

  • 1.  How to handle Custom URI Handling

    Posted Aug 07, 2017 03:57 PM

    Hello,

     

    I have a scenario where I need have two separate policies on a gateway that listen to two similar URI patterns. Each URI pattern must match separately so I can avoid policy logic branching and have portal analytics for each endpoint.

     

     

    Scenarios:

    1. Proxy URL: http://gateway:8080/weather/stations/*
    2. Proxy URL: http://gateway:8080/weather/stations/*/hourlyobservation 

     

    Is there a way to set up two unique policies that each have their own custom resolution paths like above?

     

    What I have found is that all requests route to the base URL endpoint because its matching the base first.

    I have also tried setting up a global message-received fragment that uses the "resolve service" assertion but it appears to still route to the base every time. Ideally we could use a regex pattern in the custom resolution path. This seems like a fairly basic use case. How do you usally deal with this type of REST pattern?



  • 2.  Re: How to handle Custom URI Handling
    Best Answer

    Broadcom Employee
    Posted Aug 07, 2017 04:28 PM

    Hello,

     

    Add the asterick to the end of the second URL will resolve and allow this to work as you describe. 

     

    /weather/stations/*/hourlyobservation*

     

    Scenarios:

    1. Proxy URL: http://gateway:8080/weather/stations/*
    2. Proxy URL: http://gateway:8080/weather/stations/*/hourlyobservation*

     

    Barry



  • 3.  Re: How to handle Custom URI Handling

    Posted Aug 07, 2017 04:42 PM

    Thank you. That worked like a charm



  • 4.  Re: How to handle Custom URI Handling

    Posted Oct 23, 2017 12:43 PM

    I have two URL patterns and need two different service endpoints


    http://gateway:8080/v1/user/{userid}/account/{accountid}
    http://gateway:8080/v1/user/{userid}

     

    How should i place my custom resolution path?



  • 5.  Re: How to handle Custom URI Handling

    Broadcom Employee
    Posted Nov 09, 2017 01:04 PM


  • 6.  Re: How to handle Custom URI Handling

    Posted Mar 08, 2019 10:01 AM

    We are dealing with this problem of Layer 7's simplistic URI matching. I fail to understand why appending a * to the more specific (longer) URI can prevent the less specific (shorter) one from capturing requests intended for the other. What is the URI matching algorithm?