Simple service registry for routing
This pattern is provided courtesy of a customer and upcoming partner entreprise, where it is in use in production.
Requirements :
- resolve web service URLs according to deployment environment
- easy development, easy to update when a new one rolls out
Solution :
- use a property file, one version per environment, loaded from filesystem by the SOA runtime, with properties like “[service alias]=[service URL]“
- for easier deployment, can also be loaded HTTP using a Java URL, or a mounted folder
Even easier with EasySOA :
- Use EasySOA to generate the property file : gather service URLs using service discovery (for instance Discovery By Browsing, by browsing the pages where your service stacks list the services they expose), then write a simple client (JUnit test, nodejs…) using the Remote APIs to access the service registry, get them and write them in a file. Service alias (property names) can be taken from any other service data there is (service name…).
A fews ideas for scaling it up with EasySOA :
- Define and add your own “service alias” metadata to the EasySOA service registry, and fill and manage it online.
- Also generate your property file from your development environment, and add a unit test to compare it to the one generated by EasySOA.
- Or even use a full blown Entreprise Service Bus, and adapt your unit test to compare ESB-known services to EasySOA detected ones.
