File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
mse-simple-demo/C/src/main/java/com/alibabacloud/mse/demo/c Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -103,16 +103,21 @@ public String spring_boot() {
103
103
return "C" + serviceTag + "[" + inetUtils .findFirstNonLoopbackAddress ().getHostAddress () + "]" ;
104
104
}
105
105
106
-
107
106
@ GetMapping ("/flow" )
108
- public String flow () throws ExecutionException , InterruptedException {
107
+ public String flow () {
109
108
try (Entry entry1 = SphU .entry ("HelloWorld-c-flow-1" , EntryType .IN )) {
110
109
log .debug ("Hello Sentinel!1" );
111
110
try (Entry entry2 = SphU .entry ("HelloWorld-c-flow-2" , EntryType .IN )) {
112
111
log .debug ("Hello Sentinel!2" );
113
- long sleepTime = 5 + RANDOM .nextInt (5 );
114
- silentSleep (sleepTime );
115
- return "C" + serviceTag + "[" + inetUtils .findFirstNonLoopbackAddress ().getHostAddress () + "]" + " sleepTime:" + sleepTime ;
112
+ try {
113
+ long sleepTime = 5 + RANDOM .nextInt (5 );
114
+ silentSleep (sleepTime );
115
+ return "C" + serviceTag + "[" + inetUtils .findFirstNonLoopbackAddress ().getHostAddress () + "]" + " sleepTime:" + sleepTime ;
116
+ } catch (Throwable throwable ) {
117
+ entry2 .setError (throwable );
118
+ entry1 .setError (throwable );
119
+ throw throwable ;
120
+ }
116
121
} catch (BlockException e ) {
117
122
throw new RuntimeException (e );
118
123
}
You can’t perform that action at this time.
0 commit comments