Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Jeepay
Commits
bafce062
Commit
bafce062
authored
Jul 27, 2021
by
terrfly
Browse files
catchException 避免商户通知时http连接异常导致不再发送;
parent
eb1c12bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/mq/PayOrderMchNotifyMQReceiver.java
View file @
bafce062
...
...
@@ -15,6 +15,7 @@
*/
package
com.jeequan.jeepay.pay.mq
;
import
cn.hutool.core.net.url.UrlBuilder
;
import
cn.hutool.http.HttpException
;
import
cn.hutool.http.HttpUtil
;
import
com.jeequan.jeepay.components.mq.model.PayOrderMchNotifyMQ
;
...
...
@@ -68,8 +69,9 @@ public class PayOrderMchNotifyMQReceiver implements PayOrderMchNotifyMQ.IMQRecei
String
res
=
""
;
try
{
res
=
HttpUtil
.
createPost
(
notifyUrl
).
timeout
(
20000
).
execute
().
body
();
}
catch
(
Http
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"http error"
,
e
);
res
=
"连接["
+
UrlBuilder
.
of
(
notifyUrl
).
getHost
()
+
"]异常:【"
+
e
.
getMessage
()
+
"】"
;
}
if
(
currentCount
==
1
){
//第一次通知: 更新为已通知
...
...
@@ -93,11 +95,11 @@ public class PayOrderMchNotifyMQReceiver implements PayOrderMchNotifyMQ.IMQRecei
// 通知延时次数
// 1 2 3 4 5 6
// 0 30 60 90 120 150
mqSender
.
send
(
PayOrderMchNotifyMQ
.
build
(
notifyId
),
currentCount
*
30
*
1000
);
mqSender
.
send
(
PayOrderMchNotifyMQ
.
build
(
notifyId
),
currentCount
*
30
);
return
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
()
,
e
);
return
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment