File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
springboot3.0/springboot335/src/main/java/com/springboot335/springboot335/service Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11package com .springboot335 .springboot335 .service ;
22
3+ import org .springframework .retry .annotation .Backoff ;
34import org .springframework .retry .annotation .Retryable ;
45import org .springframework .stereotype .Service ;
56
7+ import java .time .LocalDateTime ;
8+ import java .time .ZoneId ;
9+ import java .time .format .DateTimeFormatter ;
10+
611
712/**
813 * 注解说明
2025
2126
2227@ Service
23- @ Retryable (value = Exception .class )
28+ @ Retryable (
29+ value = Exception .class ,
30+ backoff = @ Backoff (delay = 1000 , multiplier = 2 )
31+ )
2432public class TestServiceImpl implements TestService {
2533 @ Override
2634 public String testGet (Integer id ) {
27- System .out .println ("id = " + id );
35+ String time = LocalDateTime .now (ZoneId .systemDefault ()).format (DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm:ss" ));
36+ System .out .println ("time=" + time + " " + "id = " + id );
2837 Integer .valueOf ("a" );
2938 return "get " + id ;
3039 }
You can’t perform that action at this time.
0 commit comments