This program is to demo the potential disaster brought by cyclic references between services.
This program contains 3 applications:
- Application A
- It has a web controller: Controller A, which contains 2 services:
- a1
- a2
- It has a web controller: Controller A, which contains 2 services:
- Application B
- It has a web controller: Controller B, which contains 2 services:
- b1
- b2
- It has a web controller: Controller B, which contains 2 services:
- Application C
- It has a web controller: Controller C, which contains 2 services:
- c1
- c2
- It has a web controller: Controller C, which contains 2 services:
To demonstrate the issue with cyclic references, we designed 2 scenarios:
-
Cyclic scenario, which has the invocation hierarchy as follows:
- a1 -> b1
- b2 -> a2
- To trigger the disaster, 2 burst requests to a1 and b2 will be injected in the 5th second
-
Non cyclic scenario, which has the invocation hierarchy as follows:
- a1 -> c1
- b2 -> c2
You need to install Apache Jmeter first, and then install plugin Throughput Shaping Timer.
For your simplicity, the Throughput Shaping Timer plugin is included in this project as Throughput-Shaping-Timer-Plugin.zip.
- Make sure
test.enable-cyclicinapplication.propertiesis set totrue - Run
service.cyclic.demo.service.a.ApplicationA - Run
service.cyclic.demo.service.b.ApplicationB - Run
cyclic-demo.jmxwith Apache Jmeter - You will find the invocations start to fail since the 15th second, and will continue to fail even all the burst requests are gone, i.e. Application A and Application B can not recover from such scenarios by themselves due to the cyclic references between them
- Make sure
test.enable-cyclicinapplication.propertiesis set tofalse - Run
service.cyclic.demo.service.a.ApplicationA - Run
service.cyclic.demo.service.b.ApplicationB - Run
service.cyclic.demo.service.c.ApplicationC - Run
cyclic-demo.jmxwith Apache Jmeter - You will find the result is satisfying. Only a very small jitter happened in the 15th second