mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
在各个帧类中添加mq消息发送(部分添加用于测试)
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
package com.jsowell.common.config.mq;
|
||||
|
||||
import com.jsowell.common.constant.mq.ThirdPartyRabbitConstants;
|
||||
import org.springframework.amqp.core.Binding;
|
||||
import org.springframework.amqp.core.BindingBuilder;
|
||||
import org.springframework.amqp.core.Queue;
|
||||
import org.springframework.amqp.core.TopicExchange;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class TopicRabbitConfig {
|
||||
|
||||
/**
|
||||
* 定义交换机
|
||||
*/
|
||||
@Bean
|
||||
public TopicExchange wccThirdpartyExchange() {
|
||||
return new TopicExchange(ThirdPartyRabbitConstants.WCC_THIRDPARTY_NAME, true, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue realtimeDataPushQueue() {
|
||||
return new Queue(ThirdPartyRabbitConstants.QUEUE_REALTIME_DATA_PUSH, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue alarmPushQueue() {
|
||||
return new Queue(ThirdPartyRabbitConstants.QUEUE_ALARM_PUSH, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue chargeResultPushQueue() {
|
||||
return new Queue(ThirdPartyRabbitConstants.QUEUE_CHARGE_RESULT_PUSH, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue startupChargingFailedPushQueue() {
|
||||
return new Queue(ThirdPartyRabbitConstants.QUEUE_STARTUP_CHARGING_FAILED_PUSH, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue chargeOrderPushQueue() {
|
||||
return new Queue(ThirdPartyRabbitConstants.QUEUE_CHARGE_ORDER_PUSH, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding bindRealtimeDataPush(Queue realtimeDataPushQueue, TopicExchange wccThirdpartyExchange) {
|
||||
return BindingBuilder.bind(realtimeDataPushQueue)
|
||||
.to(wccThirdpartyExchange)
|
||||
.with("wcc.realtimeDataPush.#");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindAlarmPush(Queue alarmPushQueue, TopicExchange wccThirdpartyExchange) {
|
||||
return BindingBuilder.bind(alarmPushQueue)
|
||||
.to(wccThirdpartyExchange)
|
||||
.with("wcc.alarmPush.#");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindChargeResultPush(Queue chargeResultPushQueue, TopicExchange wccThirdpartyExchange) {
|
||||
return BindingBuilder.bind(chargeResultPushQueue)
|
||||
.to(wccThirdpartyExchange)
|
||||
.with("wcc.chargeResultPush.#");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindStartupChargingFailedPush(Queue startupChargingFailedPushQueue, TopicExchange wccThirdpartyExchange) {
|
||||
return BindingBuilder.bind(startupChargingFailedPushQueue)
|
||||
.to(wccThirdpartyExchange)
|
||||
.with("wcc.startupChargingFailedPush.#");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindChargeOrderPush(Queue chargeOrderPushQueue, TopicExchange wccThirdpartyExchange) {
|
||||
return BindingBuilder.bind(chargeOrderPushQueue)
|
||||
.to(wccThirdpartyExchange)
|
||||
.with("wcc.chargeOrderPush.#");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user