Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
fanxing3
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a56bc9bd
authored
May 08, 2024
by
毛树良
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
<fix>:繁星3.0转发优化
1 parent
bf718b51
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
fanxing-forward/src/main/java/com/viontech/fanxing/forward/batch/writer/ForwardWriter.java
fanxing-forward/src/main/java/com/viontech/fanxing/forward/batch/writer/ForwardWriter.java
View file @
a56bc9b
...
...
@@ -68,8 +68,10 @@ public class ForwardWriter implements ItemWriter<ForwardContent> {
.
bodyToMono
(
String
.
class
);
String
block
=
response
.
block
(
Duration
.
ofSeconds
(
20
));
log
.
info
(
"数据推送完成,对接名称:[{}],结果:[{}]"
,
forward
.
getName
(),
block
);
failed
=
0
;
// 发送完成重置failed为0
}
catch
(
Exception
e
)
{
failed
+=
1
;
log
.
error
(
"发送失败次数:{},对接名称[{}],url:[{}],error:[{}]"
,
failed
,
forward
.
getName
(),
forward
.
getUrl
(),
e
.
getMessage
());
if
(
failed
==
3
)
{
log
.
error
(
"发送失败,对接名称[{}],url:[{}],error:[{}]"
,
forward
.
getName
(),
forward
.
getUrl
(),
e
.
getMessage
());
}
...
...
@@ -87,6 +89,7 @@ public class ForwardWriter implements ItemWriter<ForwardContent> {
map
.
put
(
"lastSendTime"
,
new
Date
());
map
.
expire
(
10
,
TimeUnit
.
DAYS
);
}
else
if
(
failed
<
3
)
{
log
.
info
(
"发送失败进行重发, 发送任务Id:{}, 已失败次数:{}, 该任务失败次数:{}"
,
this
,
failed
,
this
.
failed
);
ForwardApp
.
THREAD_POOL_EXECUTOR
.
submit
(
this
);
}
else
{
log
.
info
(
"失败次数超过三次,不再发送,forwardId:{}"
,
forward
.
getId
());
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment