Currently we are having number of components exposing their APIs on REST and SOAP and number of web applications also existing. Below is a high-level view of some of the endpoints emulating some endpoints using sample domain will be example.com
restsvc.example.com/v2 --ELB---> | svr1.example.com/v2 |
soapsvc.example.com/v3 --ELB---> | svr2.example.com/v3 |
corpwebapp.example.com --ELB---> | svr1.example.com/someapp/index.html |
ncorpwebapp.example.com --ELB---> | svr2.example.com/anotherapp/index.html |
To address various number of usage scenarios we have introduced an ESB and now all of these APIs and even Web applications are proxy-ed via ESB.
restsvc.example.com/v2 -ELB--> |esb.example.com:8280/service/v2 | --> |svr1.example.com/v2 |
soapsvc.example.com/v2 -ELB-->|esb.example.com:8280/service/v3| -->| svr2.example.com/v3 |
corpwebapp.example.com -ELB-->|esb.example.com:8380/someapp/index.html | -->| svr1.example.com/someapp/index.html |
nonwebapp.example.com -ELB-->|esb.example.com:8480/someapp/index.html | --> | svr2.example.com/anotherapp/index.html |
All of these public apis are pointing to the ESB, but now ESB has exposed these APIs and web apps in different ports and end points. Eg: Now v2 app listen on port 8280 with path /service/v2
Since end points are changed, in order to support the existing end points with default port, ELB has to cater these requirements. But this seems tight coupling with ELB since some transformation between ports and paths needs to be done.
I have several questions
- Is this is a correct way of exposing apis via ESBs ?
- Is handling port and paths at ELB level is normal and correct behavior ?
- Is AWS ELB is capable to support this requirement ?
- If question one answers "no", is it good to have mediation level logic to route to different servers based on subdomains URL patterns etc.?