找回密码
 加入怎通
查看: 259|回复: 0

Biz-SIP业务中台案例实战(18)——调用App延迟服务(技术中台和业务中台的区别)

[复制链接]
我来看看 发表于 2023-03-17 19:14:40 | 显示全部楼层 |阅读模式
* Y0 a5 v/ ^5 X/ s& V M

Biz-SIP金融级业务中台(http://bizsip.bizmda.com)是一套基于领域驱动设计(DDD)架构,能快速构建金融级云原生架构的服务整合中间件,整合了在金融场景里锤炼出来的最佳实践分布式事务是分布式系统架构设计中的一个技术难点,特别是在这几年越来越火的微服务架构中,服务拆分所带来的跨服务数据一致性问题亟待解决,而在金融系统中,这个问题更是备受关注。

# A- r5 b, N# Q+ r: C

在Biz-SIP金融业务中台中,是利用App延迟服务,来提供对分布式事务的支持,主要场景有:1. 重试通知:通知对方系统,如果对方系统没有响应,会重新发起通知交易,直到对方给出明确的回复响应2. 向前补偿:调用第三方服务后,超时没有响应,系统会后续发起查询上笔交易状态的查询交易,如果对方系统还是没响应,会多次重试再发起交易状态查询,并根据查询交易状态来决定继续完成后续服务步骤(上笔交易终态查询结果为已成功)还是对以前服务步骤发起补偿(冲正)操作(上笔交易终态查询结果为未成功)。

! N" \$ l* u Q8 t

3. 向后补偿:调用第三方服务后,超时没有响应,系统会立即发起针对此交易的补偿交易,如果对方系统还是没响应,会多次重试再发起补偿交易补偿成功后,会对以前服务步骤依次发起补偿(冲正)操作;如果补偿失败,会置交易失败,由人工介入处理。

3 D L7 }) q C6 }% v" [1 l4 [

调用App延迟服务案例,是通过Biz-SIP的开放API接口,调用App服务,再由App服务发起对App延迟服务的多次重试调用:

2 n. T6 j# b) |% m

在以上案例中,有2个App服务:/bean/sample15:正常的App服务,被开放API接口所调用,模拟在特定场景(发起重试通知、调用第三方应用后无响应)中调用App延迟服务;/bean/sample15-delay:被调用的App延迟服务,模拟和第三方应用交互的不同场景(无响应、返回错误、返回成功)。

+ [, V. ^) G' m( M% Z

具体代码和配置可以查看Biz-SIP源代码中的Sample相关测试案例(https://gitee.com/szhengye/biz-sip)一、App层App服务的开发和配置首先,我们需要编写一个App服务类(Sample15AppService.java):

- ~$ L+ D$ Y+ X: N- N8 [

@Slf4j@ServicepublicclassSample15AppServiceimplementsAppBeanInterface{& P5 A3 H6 N6 Z, y private BizMessageInterface bizMessageInterface( g) a3 T: k# I( ^ = AppClientFactory.getDelayAppServiceClient(+ W( K4 `7 v Q- O) Z& U5 } BizMessageInterface

2 R2 u: d& a6 t' ]

.class, "/bean/sample15-delay", 5 L$ O# a& m6 Q, J# w5 ?, m 0,1000, 2000, 4000, 8000, 16000);@Overridepublic JSONObject process(JSONObject message) throws BizException { # u! E G' L+ |* I1 R& {. l BizMessage bizMessage =

$ L. M/ S% u, X7 i2 b1 }2 V* ]

this.bizMessageInterface.call(message); 7 u, \ w/ Y: a+ q7 d0 D' g R return bizMessage.getData();1 m& g0 [' v/ e& M! [ }3 S& S; X5 K* j& ^& v }Sample15AppService类继承了AppBeanInterface接口,实现了process()方法。

7 s6 W. N' P J) F3 E

Sample15AppService类中申请了调用“/bean/sample15-delay”App延迟服务的调用接口bizMessageInterface,在process()方法中,通过这个接口,来调用App延迟服务。

8 e ]; w2 S P- H% a1 o3 K. D

接着,我们还需要编写一个App服务类作为App延迟服务(Sample15DelayAppService.java):@Slf4j ' ?5 o# d+ p( _8 W: z @ServicepublicclassSample15DelayAppService

/ h( q3 U' P0 i

implementsAppBeanInterface{0 P" |6 @9 k" \4 [ @Overridepublic JSONObject process(JSONObject message)throws BizException

$ |$ P, p. n2 u/ `9 K

{ }1 k' T i2 s& X log.info("延迟App服务调用第[{}]次: \n{}", / K2 C* B7 w8 C3 n" A0 C3 O+ y BizUtils.getDelayRetryCount(), ' h/ K+ K) Q) @ BizUtils.buildJsonLog(message)); 5 k" O* t. M4 _# B$ x

& A7 G3 I8 [/ r

int maxRetryCount = message.getInt("maxRetryCount");/ m3 r8 U0 X% @+ K String result = (String) message.get("result"

% b4 [ u/ h, U, ?# r3 t0 U

);. K$ D6 d h' Z1 T if (BizUtils.getDelayRetryCount() >= maxRetryCount) { ( o! k2 A2 U6 r" n8 [+ ` if ("success".equalsIgnoreCase(result)) { : K1 K+ {: X. a" j log.info(

9 K" }+ i' e! P# |0 ]

"返回成功!");/ ^. ~2 ]) m) W return message;0 k& f1 O$ {& d J, P+ ] }% p- @) S. L. n: j8 A# G: A5 g else {6 [/ f6 i% g4 j5 H, j log.info("返回错误!"

, Z8 n+ A: p& |4 b7 L

);! [; W$ _6 s( P( F: [6 `: { thrownew BizException(BizResultEnum.OTHER_ERROR,"Sample15DelayAppService调用错误!");) T$ E4 _' d* Z0 ? } 5 w- X2 p. E/ a1 F1 U6 @( \ } : J- q) _, V2 _7 N% ]$ J log.info(

% X( L6 V: [4 Z6 ?2 j

"抛出延迟App服务重试异常,触发下一次调用..."); : l( H+ O2 V% E R! k thrownew BizException(BizResultEnum.RETRY_DELAY_APP_SERVICE);7 n' E7 T: c. C/ _ }" ^; S& D E3 ^0 b, N }

7 X# f+ ]8 v0 D* | Z2 B

Sample15AppService类同样继承了AppBeanInterface接口,实现了process()方法Sample15AppService类中,会根据传入报文中的“maxRetryCount”来决定调用次数,在没达到maxRetryCount约定的最大重试次数时,会直接抛出App服务重试异常(异常错误码为BizResultEnum.RETRY_DELAY_APP_SERVICE);传入报文中的“result”为达到最大重试次数后是返回成功(result为“success”)还是直接抛出异常(除App服务重试异常以外的其它BizException异常)。

2 Z" Q, U* V p W

然后,在app.yml中,需要配置这二个App服务:- app-service-id: /bean/sample15" g5 X) z9 r9 R& _0 g$ p type: app-bean-service* g% O- l- t* v3 F0 i! K. T, U class-name: com.bizmda.bizsip.sample.app.service.Sample15AppService

$ [1 U+ E3 @, [

- P4 s) m# ^* d 8 D, Y9 r6 o9 A3 { - app-service-id: /bean/sample15-delay( X& v+ x: {: Z [' U type: app-bean-service2 Y" }+ m6 Y8 z+ f T* i class-name: com.bizmda.bizsip.sample.app.service.Sample15DelayAppService

, e! v w' n5 V: P c; ?6 @

二、启动应用进行测试启动SampleAppApplication应用,通过OpenAPI接口进行测试首先,请求报文中设置最大重试次数(maxRetryCount)为4,最终返回结果(result)为“success”。

! r I$ o: D1 n" B% N. X+ h# r

$ curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample15" -X POST --data{"maxRetryCount":4,"result":"success"}

+ k8 a. s3 G8 i' X1 p+ B* b, O- H

http://localhost:8888/api|jq 1 q& ^: G, O$ N# i6 F# f7 G$ F : q# Z& k+ z4 b1 ` { . m) V$ I, @$ Q. Y "code": 0,' P, |. v0 ^! @( K7 V& v( } "message": "success",# l6 e' u( t; m' h, w+ V/ f "extMessage": null, / Q3 A& r o* g. s+ A "appServiceId"

- j( D& j* I6 ]1 v. }5 j; M4 Y. S

: "/bean/sample15", 0 `* S7 D/ U* O6 p" j* g8 n "traceId": "35a40e4bace44883bcb6511a3b016b82",0 q8 G9 M9 A- ?( S6 L2 G "parentTraceId": null,8 L+ l7 j+ l2 M1 W% T2 h0 O "timestamp"

; \$ V0 l/ R9 r) n- K' L' S

: 1648358690842, " n/ ]+ W$ o7 w) s0 y$ X+ [0 \6 Y "data": {0 l% V7 H2 o& n9 J, j9 M; h "maxRetryCount": 4,2 \, V7 l$ @# ~) \) x "result": "success"; z) D: }, r, T. c0 R; J( T1 m z }& v: R7 f9 a9 m* Z( ~; Q }SampleAppApplication应用中被调用的Sample15DelayAppService类打印日志:

- }/ P% x2 N7 e5 \+ n9 [/ w

[bizsip-integrator:192.169.1.103:8888] 13:24:50 INFO 70936 [7a36a3f4c22e40a49792931645570553] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

( n N1 v: P: l+ Q" K) `0 a! S

#1-4] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[1]次: % n* g: |1 m9 j2 \8 t) ?, K; p% q: ~ { J2 N5 N; @) v8 o u: K# Q "maxRetryCount": 4, " n& F$ n) \2 n, j$ g9 _% y/ X "result"

5 X$ y$ A) H2 A

: "success" - k N0 t, A' L6 P9 g2 ^. _* v8 ? }0 ^) a$ s. @; E2 A! L4 y [bizsip-integrator:192.169.1.103:8888] 13:24:50 INFO 70936 [7a36a3f4c22e40a49792931645570553] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

+ l. r# R n, }$ B- B! s& S

#1-4] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用...5 C& e( F w" E* g' w C [bizsip-integrator:192.169.1.103:8888] 13:24:51 INFO 70936 [7a36a3f4c22e40a49792931645570553] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

3 Y) S5 @ n8 d, s

#1-3] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[2]次:: h0 r. [( j# x4 f- } { , Y& \, K9 o0 e: x0 L: f. ~3 W. k "maxRetryCount": 4,6 \/ Z. u! Y E, k' t6 O( A "result"

6 X4 r5 H5 v/ P9 |6 j: Y( ?

: "success" $ ]3 o( G4 y* G( Q } ( W9 n" @- D" P# `) [2 E8 w5 d [bizsip-integrator:192.169.1.103:8888] 13:24:51 INFO 70936 [7a36a3f4c22e40a49792931645570553] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

, K5 h2 S: q6 x2 c6 {5 M7 ?

#1-3] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用... & W* E: X( r) k [bizsip-integrator:192.169.1.103:8888] 13:24:53 INFO 70936 [7a36a3f4c22e40a49792931645570553] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

0 E& X6 N: P) A# s7 f

#1-2] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[3]次:8 [# P( X2 y6 S) G, T/ s, | {: Q$ f8 D. R' H4 a "maxRetryCount": 4, 9 D! N. Q( E$ N: X; C, w3 C! u "result"

K5 \2 A. w# d+ Y$ K

: "success" 3 }5 Q: e! d e } + b* I3 o; H% {& b& a7 _ [bizsip-integrator:192.169.1.103:8888] 13:24:53 INFO 70936 [7a36a3f4c22e40a49792931645570553] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

$ R$ Q' k* C5 Z1 W) _

#1-2] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用...' @4 H& P/ J* ~( k4 P$ V. ? ?: j [bizsip-integrator:192.169.1.103:8888] 13:24:58 INFO 70936 [7a36a3f4c22e40a49792931645570553] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

" p3 z( U1 F2 s6 e3 P+ o

#1-1] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[4]次: - n; u" g! }. Q5 d' V { 6 P& E8 [; ^# a- ?; G "maxRetryCount": 4, 4 n, p/ I* g5 U% L. F "result"

$ ?" y6 j! b4 h8 W

: "success"+ A* M; }- K1 I9 W5 C4 f }1 H4 _8 Y4 D- M6 A6 s, ~ [bizsip-integrator:192.169.1.103:8888] 13:24:58 INFO 70936 [7a36a3f4c22e40a49792931645570553] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

. @0 F4 C# @- v" _- g, W0 O

#1-1] c.b.b.s.a.s.Sample15DelayAppService 返回成功!可以看到Sample15DelayAppService类一共被调用了4次,最后返回成功,中间的时间间隔分别为1秒、2秒、5秒(时间精确度关系,略有误差)。

+ r# X, \9 x- _ p% y, H# x3 T

其次,请求报文中设置最大重试次数(maxRetryCount)为3,最终返回结果(result)为“fail”$ curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample15"

6 K7 [7 w) B: }0 h5 X. k% P4 E: R- ~

-X POST --data{"maxRetryCount":3,"result":"fail"} http://localhost:8888/api|jq& J% L2 c; O0 D+ m/ K$ S : B! n2 W- L* U2 H5 d1 o N { ( A6 W% D# h6 M$ Y "code": 0,2 Z- ]4 V4 ~9 i "message"

+ o% n" J* F Y8 H) `& \) t: M" n

: "success",2 o6 W! I, C' T- I "extMessage": null,) _8 O" p) U) f3 u5 T. L "appServiceId": "/bean/sample15", " u0 D6 c, M/ i" L6 I. i$ T1 v$ \* X "traceId": "a60d017e00554dd6a779a478ced2c7f5"

/ ]( o. d. k4 j/ X" e

, 2 m% m$ h3 E4 j$ f( F2 u: d3 V "parentTraceId": null,, X. N' o% |) P/ _: c+ ^ "timestamp": 1648359627667, % w7 {& c8 C/ }2 f7 g6 S8 i6 x "data": { 3 A" S l. L3 H$ }6 ~# K3 {5 l K8 Q "maxRetryCount": 3, m9 k2 b6 N8 ~9 w! n+ F "result"

5 W' O+ @! k* O# x& y

: "fail"/ j5 T! c1 G5 L; c2 E } 4 ~0 |4 a; m3 K7 w: V }SampleAppApplication应用中被调用的Sample15DelayAppService类打印日志:[bizsip-integrator:192.169.1.103:8888] 13:40:27 INFO 70936 [2b2564ca72d74251b3e1d7bac2a99242] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

- j( E! z6 ~3 K% x5 Q' u

#1-5] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[1]次:; [$ Y0 Y) f4 {3 q { 5 G! I; a7 K0 e9 O "maxRetryCount": 3, 2 [8 H% U0 Y, W' |$ L "result"

: Y3 F o6 J3 i8 W

: "fail" 2 F8 K u" x' e( H8 p/ u }4 o7 K/ Q6 B) ~5 P8 Q( q) I [bizsip-integrator:192.169.1.103:8888] 13:40:27 INFO 70936 [2b2564ca72d74251b3e1d7bac2a99242] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

$ l7 t4 |! ?* k8 H5 q

#1-5] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用...* i3 f' E8 _$ j9 d/ k& e) ^; X [bizsip-integrator:192.169.1.103:8888] 13:40:28 INFO 70936 [2b2564ca72d74251b3e1d7bac2a99242] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

! l7 ~% S" O J* X/ R3 i

#1-4] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[2]次: " h( }7 e1 o9 _: ^- ]9 z ^ {# W% j! p8 e9 x% K% I6 W: y "maxRetryCount": 3, 1 x4 N; y7 [6 @ ~) [ "result"

6 J4 B3 i$ X6 C

: "fail"* F: }3 F1 z# v7 G: M8 s% s* F } . D& G( v, S: O6 S. B! q [bizsip-integrator:192.169.1.103:8888] 13:40:28 INFO 70936 [2b2564ca72d74251b3e1d7bac2a99242] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

& o, p1 v1 T2 s" K: K1 q/ \

#1-4] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用... " n+ f( Q I1 M: ] [bizsip-integrator:192.169.1.103:8888] 13:40:30 INFO 70936 [2b2564ca72d74251b3e1d7bac2a99242] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

/ ^8 c& ?7 M1 L8 N- j

#1-3] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[3]次:4 F5 ?) y5 J3 U+ [3 m {2 C% T. r9 |8 A "maxRetryCount": 3, " i- \* N/ C1 _ "result"

0 }2 c) I) ~# B( n& O

: "fail" . N( m4 S/ v; D }6 c! H0 B8 [" I1 N7 }; K2 f0 B [bizsip-integrator:192.169.1.103:8888] 13:40:30 INFO 70936 [2b2564ca72d74251b3e1d7bac2a99242] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

0 X$ n4 Y, E: X+ r( Y2 b

#1-3] c.b.b.s.a.s.Sample15DelayAppService 返回错误!可以看到Sample15DelayAppService类一共被调用了3次,最后返回失败,中间的时间间隔分别为1秒、2秒。

- p3 ^- o) a8 r+ a0 t O

最后,请求报文中设置最大重试次数(maxRetryCount)为8,最终返回结果(result)为“success”$ curl -H "Content-Type:application/json" -H

' ?, D n) H8 }

"Biz-Service-Id:/bean/sample15" -X POST --data{"maxRetryCount":8,"result":"success"} http://localhost:8888/api|jq

. Q) H7 a7 I" K& ?! U

9 `2 y: Y9 p7 j" O# L. D) _/ ` $ |! @7 k3 a2 O+ I# Q2 S! V {2 K1 q* }5 E9 d1 O "code": 0, - y% c+ u7 t8 t, T3 Y( y$ u+ m5 e "message": "success",) Y; a5 U7 n+ n0 O+ b7 m, a- c "extMessage": null, 2 w: F4 a/ u4 s) Q0 E "appServiceId": "/bean/sample15",% v8 y! ]* p7 s& N( O

( D; `" d2 G8 Q; _ h C" Q

"traceId": "19e559c658954b35861a32369b08f5b1",. u6 j( X- W8 E% B! t* e "parentTraceId": null, 5 ^& ?; w4 H8 q "timestamp": 1648359793722,$ K ~: t ]* ? G

1 u! f, T. P# d

"data": { 4 `' }0 W1 V- `& F( J/ Z "maxRetryCount": 8,1 `' i! ?! f' ]6 s9 V6 T "result": "success" 3 t* }& l& O; v: _; o6 ` } - ^1 y) k, _8 R7 o3 U' p }SampleAppApplication应用中被调用的Sample15DelayAppService类打印日志:

7 O0 E& m% x# O6 N% Q4 u; C

[bizsip-integrator:192.169.1.103:8888] 13:43:13 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

6 m2 C% ] b: P5 l- h# Y

#1-2] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[1]次:7 t" G: B- n! Z4 W! B { ( u, { F- h' X "maxRetryCount": 8, & d' P0 j& X& ]( {8 E" G2 _5 O "result"

( k8 R6 f5 ?, X) f3 ?% X

: "success"" y8 v6 b: E2 i: {: e! @ }& J+ m( L: R4 ~* n [bizsip-integrator:192.169.1.103:8888] 13:43:13 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

: @2 z: H/ V. D' J* M

#1-2] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用... ) H, p! l) S- D: T$ N3 m1 u [bizsip-integrator:192.169.1.103:8888] 13:43:14 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

3 e( E9 P) q8 T* }0 }

#1-1] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[2]次:' X" _, f- ]4 r {1 s4 f ]2 L; L8 m" X4 l "maxRetryCount": 8, 7 Q+ J, I: l* W0 y% x6 X! m "result"

6 Y0 K, U+ a. L" G' L" p" I5 `$ A" d1 P

: "success"3 X8 e1 L$ |" b( t. q, f } T. B1 @9 }9 ^& O3 f- E8 s8 S [bizsip-integrator:192.169.1.103:8888] 13:43:14 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

! `+ s; u" O ?/ B

#1-1] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用...; F, R; t* n9 t; L [bizsip-integrator:192.169.1.103:8888] 13:43:16 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

7 x0 o0 K, p8 h6 E4 G

#1-5] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[3]次:2 y# [4 ?: t( ]! l* v {% B' Q' F1 n8 D8 c: o A "maxRetryCount": 8,. \6 O# c5 k# z: _# v$ v$ E B! G "result"

8 l- g3 O& E' ^. [ b" z

: "success" a* Y7 a5 }6 N2 k) y! M7 A x4 ^3 W9 S! W } & R' ^. ?! m! u" C [bizsip-integrator:192.169.1.103:8888] 13:43:16 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

: F3 C6 t, f$ c; [+ u

#1-5] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用... 4 k6 o( g5 G# l5 G4 M+ R8 V [bizsip-integrator:192.169.1.103:8888] 13:43:20 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

- z7 W6 v1 \# r; M- S& v/ }

#1-4] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[4]次: 2 \$ W9 V" K% i4 d" x4 B# b {+ |/ p' @( G4 s3 j! T4 l; A5 T) R "maxRetryCount": 8,7 e+ T5 O* K0 H9 e "result"

: G1 i$ b' ?$ s6 X' l

: "success" 5 w6 K/ S+ G5 ]: H N2 o }7 P$ @8 k7 g2 U% U+ ]) l [bizsip-integrator:192.169.1.103:8888] 13:43:20 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

1 X2 `( J# u3 a i9 k, A

#1-4] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用.../ X" C2 s+ x3 R+ q [bizsip-integrator:192.169.1.103:8888] 13:43:28 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

. e$ _; s3 O8 v7 k1 V

#1-3] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[5]次:+ d" |( M! u$ Z# w {3 s# V3 h% w; E1 U "maxRetryCount": 8, ( s* M$ H0 [9 o( s& Z, }( c9 ~8 X "result"

& O5 V: P& _! X

: "success"" d6 n! o& c% r! ^( [$ ] K } # G/ a6 U+ N) I9 @& j/ P [bizsip-integrator:192.169.1.103:8888] 13:43:28 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

/ R6 w u# [1 ^: F4 W" r

#1-3] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用...; b1 `$ j$ `8 P# T7 _$ | [bizsip-integrator:192.169.1.103:8888] 13:43:44 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

) G( ] u4 C3 m8 u0 s

#1-2] c.b.b.s.a.s.Sample15DelayAppService 延迟App服务调用第[6]次: % z8 P/ `- b% a. R7 w1 q! s0 [; G {, p% ]- o( o1 L7 }. g "maxRetryCount": 8,& l q- D8 ]! `5 M; c "result"

1 G. S; g+ R: F s" Y( Q

: "success" $ {' f/ h8 Z5 V% @4 W% } }, |7 u6 w6 B* [. N. `8 z X [bizsip-integrator:192.169.1.103:8888] 13:43:44 INFO 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

& z( M) _5 ]1 V* B% _

#1-2] c.b.b.s.a.s.Sample15DelayAppService 抛出延迟App服务重试异常,触发下一次调用...5 Q' B+ D2 ~4 M8 \ [bizsip-integrator:192.169.1.103:8888] 13:43:44 WARN 70936 [6040bebfe86545e5a5bdbf36e4e25376] [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer

4 J) _( j) [( _

#1-2] c.b.b.a.l.DelayAppServiceQueueListener 延迟App服务重试次数超过次数[6],服务失败!可以看到Sample15DelayAppService类一共被调用了6次,最后提示“延迟App服务重试次数超过次数[6],服务失败!”,中间的时间间隔分别为1秒、2秒、4秒、8秒、16秒。

% p- C2 q: I9 `

Biz-SIP官方网站:http://bizsip.bizmda.comGitee:https://gitee.com/szhengye/biz-sip

7 F# Z* F/ H2 ~# D 0 o! B& Q) w& c" \6 m! B; O& Y ' n, q; `; x$ o6 R8 G& f4 L 3 I; N) j. ~, }* ~, t" X * D& Z; K$ j$ ^: E9 j( P' _
回复

使用道具 举报

    您需要登录后才可以回帖 登录 | 加入怎通

    本版积分规则

    QQ|手机版|小黑屋|网站地图|真牛社区 ( 苏ICP备2023040716号-2 )

    GMT+8, 2026-7-8 17:23 , Processed in 0.059898 second(s), 29 queries , Gzip On.

    免责声明:本站信息来自互联网,本站不对其内容真实性负责,如有侵权等情况请联系420897364#qq.com(把#换成@)删除。

    Powered by Discuz! X3.5

    快速回复 返回顶部 返回列表