@@ -22,6 +22,10 @@ public class DemoController {
22
22
@ Value ("${demo.qps:100}" )
23
23
private int qps ;
24
24
25
+ @ Value ("${enable.mq.invoke:false}" )
26
+ private boolean enableMqInvoke ;
27
+
28
+
25
29
@ Value ("${background.color:white}" )
26
30
private String backgroundColor ;
27
31
@@ -60,19 +64,48 @@ public void run() {
60
64
}, 100 , 1000000 / qps , TimeUnit .MICROSECONDS );
61
65
62
66
63
-
64
67
FLOW_EXECUTOR .scheduleAtFixedRate (new Runnable () {
65
68
@ Override
66
69
public void run () {
67
70
68
71
try (CloseableHttpClient httpClient = HttpClientBuilder .create ().build ()) {
69
- HttpGet httpGet = new HttpGet ("http://localhost:20000/A/a" );
70
- httpGet .addHeader ("x-mse-tag" , "gray" );
72
+ HttpGet httpGet = new HttpGet ("http://localhost:20000/A/a?name=xiaoming " );
73
+ // httpGet.addHeader("x-mse-tag", "gray");
71
74
httpClient .execute (httpGet );
72
75
73
76
} catch (Exception ignore ) {
74
77
}
75
78
}
76
79
}, 100 , 10 * 1000000 / qps , TimeUnit .MICROSECONDS );
80
+
81
+ if (enableMqInvoke ){
82
+ FLOW_EXECUTOR .scheduleAtFixedRate (new Runnable () {
83
+ @ Override
84
+ public void run () {
85
+
86
+ try (CloseableHttpClient httpClient = HttpClientBuilder .create ().build ()) {
87
+ HttpGet httpGet = new HttpGet ("http://localhost:20000/A/dubbo" );
88
+ httpClient .execute (httpGet );
89
+
90
+ } catch (Exception ignore ) {
91
+ }
92
+ }
93
+ }, 100 , 1000000 / qps , TimeUnit .MICROSECONDS );
94
+
95
+
96
+ FLOW_EXECUTOR .scheduleAtFixedRate (new Runnable () {
97
+ @ Override
98
+ public void run () {
99
+
100
+ try (CloseableHttpClient httpClient = HttpClientBuilder .create ().build ()) {
101
+ HttpGet httpGet = new HttpGet ("http://localhost:20000/A/dubbo?name=xiaoming" );
102
+ // httpGet.addHeader("x-mse-tag", "gray");
103
+ httpClient .execute (httpGet );
104
+
105
+ } catch (Exception ignore ) {
106
+ }
107
+ }
108
+ }, 100 , 10 * 1000000 / qps , TimeUnit .MICROSECONDS );
109
+ }
77
110
}
78
111
}
0 commit comments