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
81c94049
Commit
81c94049
authored
Jun 28, 2021
by
xiaoyu
Browse files
增加RabbitMQ兼容
parent
7d78af1a
Changes
65
Hide whitespace changes
Inline
Side-by-side
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/mq/topic/RabbitMqTopic4ModifyIsvInfo.java
0 → 100644
View file @
81c94049
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jeequan.jeepay.pay.mq.topic
;
import
com.jeequan.jeepay.core.constants.CS
;
import
com.jeequan.jeepay.pay.service.ConfigContextService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.annotation.RabbitHandler
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.jms.annotation.JmsListener
;
import
org.springframework.stereotype.Component
;
/**
* 更改ISV信息
*
* @author xiaoyu
* @site https://www.jeepay.vip
* @date 2021/6/25 17:10
*/
@Slf4j
@Component
@Profile
(
CS
.
MQTYPE
.
RABBIT_MQ
)
public
class
RabbitMqTopic4ModifyIsvInfo
{
@Autowired
private
ConfigContextService
configContextService
;
/** 接收 更新系统配置项的消息 **/
@RabbitListener
(
queues
=
CS
.
MQ
.
TOPIC_MODIFY_ISV_INFO
)
public
void
receive
(
String
isvNo
)
{
log
.
info
(
"重置ISV信息, msg={}"
,
isvNo
);
configContextService
.
initIsvConfigContext
(
isvNo
);
}
}
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/mq/topic/RabbitMqTopic4ModifyMchInfo.java
0 → 100644
View file @
81c94049
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jeequan.jeepay.pay.mq.topic
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jeequan.jeepay.core.constants.CS
;
import
com.jeequan.jeepay.pay.service.ConfigContextService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.jms.annotation.JmsListener
;
import
org.springframework.stereotype.Component
;
/**
* 更改商户信息
*
* @author xiaoyu
* @site https://www.jeepay.vip
* @date 2021/6/25 17:10
*/
@Slf4j
@Component
@Profile
(
CS
.
MQTYPE
.
RABBIT_MQ
)
public
class
RabbitMqTopic4ModifyMchInfo
{
@Autowired
private
ConfigContextService
configContextService
;
/** 接收 [商户配置信息] 的消息
* 已知推送节点:
* 1. 更新商户基本资料和状态
* 2. 删除商户时
* **/
@RabbitListener
(
queues
=
CS
.
MQ
.
TOPIC_MODIFY_MCH_INFO
)
public
void
receive
(
String
mchNo
)
{
log
.
info
(
"接收 [商户配置信息] 的消息, msg={}"
,
mchNo
);
configContextService
.
initMchInfoConfigContext
(
mchNo
);
}
/** 接收 [商户应用支付参数配置信息] 的消息
* 已知推送节点:
* 1. 更新商户应用配置
* 2. 删除商户应用配置
* **/
@RabbitListener
(
queues
=
CS
.
MQ
.
TOPIC_MODIFY_MCH_APP
)
public
void
receiveMchApp
(
String
mchNoAndAppId
)
{
log
.
info
(
"接收 [商户应用支付参数配置信息] 的消息, msg={}"
,
mchNoAndAppId
);
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
parse
(
mchNoAndAppId
);
configContextService
.
initMchAppConfigContext
(
jsonObject
.
getString
(
"mchNo"
),
jsonObject
.
getString
(
"appId"
));
}
}
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/mq/topic/RabbitMqTopic4ModifySysConfig.java
0 → 100644
View file @
81c94049
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jeequan.jeepay.pay.mq.topic
;
import
com.jeequan.jeepay.core.constants.CS
;
import
com.jeequan.jeepay.service.impl.SysConfigService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.jms.annotation.JmsListener
;
import
org.springframework.stereotype.Component
;
/**
* 更改系统配置参数
*
* @author xiaoyu
* @site https://www.jeepay.vip
* @date 2021/6/25 17:10
*/
@Slf4j
@Component
@Profile
(
CS
.
MQTYPE
.
RABBIT_MQ
)
public
class
RabbitMqTopic4ModifySysConfig
{
@Autowired
private
SysConfigService
sysConfigService
;
/** 接收 更新系统配置项的消息 **/
@RabbitListener
(
queues
=
CS
.
MQ
.
TOPIC_MODIFY_SYS_CONFIG
)
public
void
receive
(
String
msg
)
{
log
.
info
(
"成功接收更新系统配置的订阅通知, msg={}"
,
msg
);
sysConfigService
.
initDBConfig
(
msg
);
log
.
info
(
"系统配置静态属性已重置"
);
}
}
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/service/PayMchNotifyService.java
View file @
81c94049
...
...
@@ -21,7 +21,7 @@ import com.jeequan.jeepay.core.entity.PayOrder;
import
com.jeequan.jeepay.core.entity.RefundOrder
;
import
com.jeequan.jeepay.core.utils.JeepayKit
;
import
com.jeequan.jeepay.core.utils.StringKit
;
import
com.jeequan.jeepay.pay.mq.queue.
MqQueue4PayOrderMchNotify
;
import
com.jeequan.jeepay.pay.mq.queue.
service.MqServiceImpl
;
import
com.jeequan.jeepay.pay.rqrs.payorder.QueryPayOrderRS
;
import
com.jeequan.jeepay.pay.rqrs.refund.QueryRefundOrderRS
;
import
com.jeequan.jeepay.service.impl.MchNotifyRecordService
;
...
...
@@ -42,7 +42,7 @@ import org.springframework.stereotype.Service;
public
class
PayMchNotifyService
{
@Autowired
private
MchNotifyRecordService
mchNotifyRecordService
;
@Autowired
private
Mq
Queue4PayOrderMchNotify
mqPayOrderMchNotifyQueu
e
;
@Autowired
private
Mq
ServiceImpl
mqServic
e
;
@Autowired
private
ConfigContextService
configContextService
;
...
...
@@ -84,7 +84,7 @@ public class PayMchNotifyService {
//推送到MQ
Long
notifyId
=
mchNotifyRecord
.
getNotifyId
();
mqPayOrderMchNotify
Queue
.
send
(
notifyId
+
""
);
mq
Service
.
PayOrderMchNotify
(
notifyId
+
""
);
}
catch
(
Exception
e
)
{
log
.
error
(
"推送失败!"
,
e
);
...
...
@@ -129,7 +129,7 @@ public class PayMchNotifyService {
//推送到MQ
Long
notifyId
=
mchNotifyRecord
.
getNotifyId
();
mqPayOrderMchNotify
Queue
.
send
(
notifyId
+
""
);
mq
Service
.
PayOrderMchNotify
(
notifyId
+
""
);
}
catch
(
Exception
e
)
{
log
.
error
(
"推送失败!"
,
e
);
...
...
jeepay-payment/src/main/resources/application.yml
View file @
81c94049
...
...
@@ -51,8 +51,8 @@ spring:
database
:
3
#1库:运营平台 #2库:商户系统 #3库:支付网关
password
:
#activeMQ配置
activemq
:
broker-url
:
tcp://localhost:61616
#连接地址
#
activemq:
#
broker-url: tcp://localhost:61616 #连接地址
#日志配置参数。
# 当存在logback-spring.xml文件时: 该配置将引进到logback配置, springboot配置不生效。
...
...
Prev
1
2
3
4
Next
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