Service Virtualization

We have deployed the API mocking/simulation layer on staging environment. The purpose of introducing this intermediate layer is to extricate the services from  dependency on the external peripheral systems.
We have achieved this using Hoverfly(https://docs.hoverfly.io/en/latest/#), which provides service virtualization, wherein

1. We can record realtime requests and responses.

2. Replay the recorded requests.

3. Edit the responses to fulfil specific requirements

4. Simulate API’s which are still under development etc.


With this in place, all requests going to external systems will be routed through Hoverfly, which acts as a proxy between our service and the destination system.
The setup and development has been divided into phases.

Phase 1:

1. Server installation and setup

2. Two way ssl setup

3. Flag based Implementation

4. Request/Response recording


Phase 2:

1. Define request matching rules

2. Create functional flow wise simulations
The biggest challenge during the setup till now was implementing two way ssl via proxy.Adding some reference links for the same: https://hoverfly.readthedocs.io/en/latest/pages/tutorials/advanced/configuressl/configuressl.html-configuressl

https://www.codeproject.com/Articles/326574/An-Introduction-to-Mutual-SSL-Authentication

Setup has been deployed on XYZ-staging server() 
The end goal of this activity is to be able to remove any blockers which are faced during development due to unavailibilty of third party services, as well as mock behaviours(such as introduce latency) for internal dev and testing. Also, this setup will remain available only on lower environments, production setup will remain as is.

Comparison between different available framework

1. Wilma doesn’t have updated jars on maven central
2. Wilma – not enough documentation around their java-api
3. While Wilma has a GUI, it requires alot of effort to create the stubs for every api.
4. Flashback isn’t mavenised
5. Mock server doesn’t seem very extensible
6. Wiremock, flashback, hoverfly are good incase add-on customizable features need to be built on top.
7. Wiremock is the only service virtualization tool with an active community as well as production live systems listed on their website. (More credibility. Like, Intuit)
8. Every solution is either all proxy or all stub, there is no capability to configure it at an api level.

Leave a comment