Forum Discussion

eric_the_tester's avatar
eric_the_tester
Occasional Contributor
3 years ago

Virtual Service - Conditional Routing based on request data and database lookup

For ReadyAPI Virtual Service, Is there a way to route based on the value of a database query (augmented with some request value)? 

 

I have a request with no static identifier, the only identifier is a guid (a random string of alpha numeric characters). I would like to perform a database look up on what user/value this guid maps to and then decide to route it or not.

 

I know there is database sources, however most documentation cites datasources for use in the response.

 

Any insight is appreciated.

 

Thanks!

2 Replies

    • eric_the_tester's avatar
      eric_the_tester
      Occasional Contributor

      Thanks for the response.

       

      In my case, it is a REST Service, there are instances in which parameters are used, however none of which are adequate for the routing logic.

       

      I'd like to avoid reaching the Dispatch stage unless there is a way to re-route the request to the actual service instead of using a mocked response.

       

      I have many apis in which they only identifier is a random string that needs a mapping to a database value in order to determine to route or not.