Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
a8577563
Commit
a8577563
authored
Jul 22, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mq启动失败修改
parent
9c80729f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
order-application-service/src/main/java/cn/freemud/amp/config/DlPaymentMqConfig.java
+7
-2
order-application-service/src/main/java/cn/freemud/service/impl/PaymentQueueService.java
+6
-2
No files found.
order-application-service/src/main/java/cn/freemud/amp/config/DlPaymentMqConfig.java
View file @
a8577563
...
...
@@ -20,6 +20,11 @@ public class DlPaymentMqConfig {
public
static
final
String
OPEN_STORE_PAYMENT_QUERY_KEY
=
"open_store_payment_query_key"
;
@Bean
(
"dlPaymentMqTopicExchange"
)
public
Exchange
dlPaymentMqTopicExchange
()
{
return
ExchangeBuilder
.
topicExchange
(
TopicExchangeConfig
.
EXCHANGE_NAME
).
durable
(
true
).
build
();
}
/**
* 写入RabbitMQ使用的默认队列
*
...
...
@@ -38,7 +43,7 @@ public class DlPaymentMqConfig {
* @return 消息队列绑定
*/
@Bean
(
"bindingPaymentQueueChange"
)
Binding
bindingPaymentChange
(
@Qualifier
(
"paymentQueueName"
)
Queue
queue
,
@Qualifier
(
"
orderPush
TopicExchange"
)
Exchange
topicExchange
)
{
Binding
bindingPaymentChange
(
@Qualifier
(
"paymentQueueName"
)
Queue
queue
,
@Qualifier
(
"
dlPaymentMq
TopicExchange"
)
Exchange
topicExchange
)
{
return
BindingBuilder
.
bind
(
queue
).
to
(
topicExchange
).
with
(
OPEN_STORE_PAYMENT_QUERY_KEY
).
noargs
();
}
...
...
@@ -56,7 +61,7 @@ public class DlPaymentMqConfig {
}
@Bean
(
"bindingPaymentDlChange"
)
Binding
bindingPaymentDlChange
(
@Qualifier
(
"paymentChangeDlQueue"
)
Queue
queue
,
@Qualifier
(
"
orderPush
TopicExchange"
)
Exchange
topicExchange
)
{
Binding
bindingPaymentDlChange
(
@Qualifier
(
"paymentChangeDlQueue"
)
Queue
queue
,
@Qualifier
(
"
dlPaymentMq
TopicExchange"
)
Exchange
topicExchange
)
{
Map
<
String
,
Object
>
args
=
new
HashMap
<>(
2
);
args
.
put
(
"x-dead-letter-exchange"
,
TopicExchangeConfig
.
EXCHANGE_NAME
);
args
.
put
(
"x-dead-letter-routing-key"
,
OPEN_STORE_PAYMENT_QUERY_KEY
);
...
...
order-application-service/src/main/java/cn/freemud/service/impl/PaymentQueueService.java
View file @
a8577563
...
...
@@ -3,6 +3,7 @@ package cn.freemud.service.impl;
import
cn.freemud.amp.config.DlPaymentMqConfig
;
import
cn.freemud.amqp.Header
;
import
cn.freemud.amqp.MQMessage
;
import
cn.freemud.amqp.MQService
;
import
cn.freemud.entities.dto.pay.PaymentMqMessageDto
;
import
com.alibaba.fastjson.JSON
;
import
com.freemud.application.sdk.api.config.TopicExchangeConfig
;
...
...
@@ -15,8 +16,10 @@ import org.springframework.stereotype.Component;
@Component
public
class
PaymentQueueService
{
// @Autowired
// private RabbitTemplate restTemplate;
@Autowired
private
RabbitTemplate
restTemplat
e
;
private
MQService
mqServic
e
;
public
void
paymentCallback
(
PaymentMqMessageDto
dto
){
...
...
@@ -32,6 +35,7 @@ public class PaymentQueueService {
messageProperties
.
setContentType
(
MessageProperties
.
CONTENT_TYPE_JSON
);
Message
delmessage
=
new
Message
(
notifyMsgBytes
,
messageProperties
);
// logger.info("restTemplate.convertAndSend:"+dto);
restTemplate
.
convertAndSend
(
TopicExchangeConfig
.
EXCHANGE_NAME
,
DlPaymentMqConfig
.
OPEN_STORE_PAYMENT_QUERY_DL_KEY
,
delmessage
);
mqService
.
convertAndSend
(
TopicExchangeConfig
.
EXCHANGE_NAME
,
DlPaymentMqConfig
.
OPEN_STORE_PAYMENT_QUERY_DL_KEY
,
delmessage
);
// restTemplate.convertAndSend(TopicExchangeConfig.EXCHANGE_NAME, DlPaymentMqConfig.OPEN_STORE_PAYMENT_QUERY_DL_KEY, delmessage);
}
}
Write
Preview
Markdown
is supported
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