Routing in services.json

The order in which services are listed in the services.json configuration file is significant for which requests are handled by which services (i.e. routing). The first service to match the incoming request (only) processes it.

This can be used in various ways. The simplest is to have a service take over a subtree of requests from another service by setting the first services path to a base path including the base path of the second and putting the first before the second in the order of the service.json.

Overlays

The second is via services known as overlays. Overlays are placed at a high point in ordering of service.json. Internally they perform pre-processing before the message is passed on. Passing on the message is done by starting looking for further matches to the message's url starting with the next service after the overlay and continuing down the services.json list. In this way an overlay can preprocess messages before they reach several other overlaid services. Overlays can also post process a message once it has been processed by the overlaid service.