If you want to intercept service MYSERVICE, you can write write an general service named INTERCEPTOR and do the following:
- Unadvertise MYSERVICE and advertise it with name INTER_MYSERVICE
- Advertise the INTERCEPTOR with the name MYSERVICE
- The INTERCEPTOR-service must look with which name it was called (MYSERVICE) and has to forward the call to the service with name INTER_name, in this case INTER_MYSERVICE.
This configuration can be done dynamically without restarts.
I use this for debugging/logging-purpose in development, where it works quite well. I'm not sure whether I would use it in production. Also we only use XOCTET buffer-types, which makes it easier, but I think it should work with different buffer-types as well.
Also doing it for hundreds of services at the same time might become a problem.