WSO2 ApiManager Routing Database

Viewed 29

I have a requirement with ApiManager DataService, I need to same request and same response but connect to different database based on a request attribute named year. Is it possible? or I have to create a dataservice by year? Thanks

1 Answers

You cannot conditionally change the Datasource based on a parameter.

If you want to use the same Dtaservice, you can have different contexts for the two requests like below. But still, you will have to add new query and the Datasource config.

<WSO2_URL>/Dataservice/getSomething/year1

<WSO2_URL>/Dataservice/getSomething/year2
Related