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() {
103103 return "C" + serviceTag + "[" + inetUtils .findFirstNonLoopbackAddress ().getHostAddress () + "]" ;
104104 }
105105
106-
107106 @ GetMapping ("/flow" )
108- public String flow () throws ExecutionException , InterruptedException {
107+ public String flow () {
109108 try (Entry entry1 = SphU .entry ("HelloWorld-c-flow-1" , EntryType .IN )) {
110109 log .debug ("Hello Sentinel!1" );
111110 try (Entry entry2 = SphU .entry ("HelloWorld-c-flow-2" , EntryType .IN )) {
112111 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+ }
116121 } catch (BlockException e ) {
117122 throw new RuntimeException (e );
118123 }
You can’t perform that action at this time.
0 commit comments