From 8e232144615734d62e6dd0293956aca8bcc44e40 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Mon, 24 Aug 2026 14:13:39 +0800
Subject: [PATCH] fix(gate): 修复心跳调度器中服务器端口获取问题
---
src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java | 78 ++++++++++++++++++++++++++++++++------
1 files changed, 65 insertions(+), 13 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java b/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
index 29cae2e..0c12c52 100644
--- a/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
+++ b/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
@@ -21,36 +21,35 @@
@Configuration
public class RabbitMqConfig {
- public static final String EXCHANGE_ONE = "excoin-exchange-one";
+ public static final String EXCHANGE_ONE = "biue-exchange-one";
public static final String QUEUE_TEST = "test-queue";
public static final String ROUTING_KEY_TEST = "test-routingKey";
- public static final String EXCHANGE_A = "biyi-exchange-A";
+ public static final String EXCHANGE_A = "biue-exchange-A";
// 开多止盈队列
- public static final String QUEUE_MOREPRO = "QUEUE_MOREPRO";
+ public static final String QUEUE_MOREPRO = "QUEUE_MOREPRO_NEW";
// 开空止盈队列
- public static final String QUEUE_LESSPRO = "QUEUE_LESSPRO";
+ public static final String QUEUE_LESSPRO = "QUEUE_LESSPRO_NEW";
// 开多止损队列
- public static final String QUEUE_MORELOSS = "QUEUE_MORELOSS";
+ public static final String QUEUE_MORELOSS = "QUEUE_MORELOSS_NEW";
// 开空止损队列
- public static final String QUEUE_LESSLOSS = "QUEUE_LESSLOSS";
+ public static final String QUEUE_LESSLOSS = "QUEUE_LESSLOSS_NEW";
// 限价委托
- public static final String QUEUE_LIMIT = "QUEUE_LIMIT";
+ public static final String QUEUE_LIMIT = "QUEUE_LIMIT_NEW";
// 爆仓队列
- public static final String QUEUE_COINOUT = "QUEUE_COINOUT";
+ public static final String QUEUE_COINOUT = "QUEUE_COINOUT_NEW";
//价格操作
- public static final String QUEUE_PRICEOPERATE = "QUEUE_PRICEOPERATE";
+ public static final String QUEUE_PRICEOPERATE = "QUEUE_PRICEOPERATE_NEW";
// 平仓队列
- public static final String QUEUE_CLOSETRADE = "QUEUE_CLOSETRADE";
-
+ public static final String QUEUE_CLOSETRADE = "QUEUE_CLOSETRADE_NEW";
// 开多止盈路由键
@@ -72,6 +71,18 @@
public static final String ROUTINGKEY_PRICEOPERATE = "ROUTINGKEY_PRICEOPERATE";
// 平仓路由
public static final String ROUTINGKEY_CLOSETRADE = "ROUTINGKEY_CLOSETRADE";
+
+ // ==================== Gate 策略管理 ====================
+ /** Gate 管理交换机 */
+ public static final String EXCHANGE_GATE = "biue-exchange-gate";
+ /** 心跳+事件+确认 队列(Station 独占消费) */
+ public static final String QUEUE_GATE_HEARTBEAT = "QUEUE_GATE_HEARTBEAT";
+ /** 心跳+事件+确认 路由键 */
+ public static final String ROUTINGKEY_GATE_HEARTBEAT = "ROUTINGKEY_GATE_HEARTBEAT";
+ /** 策略事件队列(Station 消费落库) */
+ public static final String QUEUE_GATE_STATS = "QUEUE_GATE_STATS";
+ /** 策略事件路由键 */
+ public static final String ROUTINGKEY_GATE_STATS = "ROUTINGKEY_GATE_STATS";
@Resource
private ConnectionFactory connectionFactory;
@@ -118,9 +129,9 @@
}
-
/**
* 开多止盈队列
+ *
* @return
*/
@Bean
@@ -131,6 +142,7 @@
/**
* 开空止盈队列
+ *
* @return
*/
@Bean
@@ -141,6 +153,7 @@
/**
* 开多止损
+ *
* @return
*/
@Bean
@@ -151,6 +164,7 @@
/**
* 开空止损
+ *
* @return
*/
@Bean
@@ -161,6 +175,7 @@
/**
* 限价委托
+ *
* @return
*/
@Bean
@@ -171,6 +186,7 @@
/**
* 爆仓
+ *
* @return
*/
@Bean
@@ -180,6 +196,7 @@
/**
* 价格操作
+ *
* @return
*/
@Bean
@@ -189,6 +206,7 @@
/**
* 价格操作
+ *
* @return
*/
@Bean
@@ -197,9 +215,9 @@
}
-
/**
* 开多止盈
+ *
* @return
*/
@Bean
@@ -209,6 +227,7 @@
/**
* 开空止盈
+ *
* @return
*/
@Bean
@@ -218,6 +237,7 @@
/**
* 开多止损
+ *
* @return
*/
@Bean
@@ -227,6 +247,7 @@
/**
* 开空止损
+ *
* @return
*/
@Bean
@@ -237,6 +258,7 @@
/**
* 委托
+ *
* @return
*/
@Bean
@@ -247,6 +269,7 @@
/**
* 爆仓
+ *
* @return
*/
@Bean
@@ -257,6 +280,7 @@
/**
* 价格操作
+ *
* @return
*/
@Bean
@@ -266,6 +290,7 @@
/**
* 平仓绑定
+ *
* @return
*/
@Bean
@@ -273,4 +298,31 @@
return BindingBuilder.bind(queueCloseTrade()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_CLOSETRADE);
}
+ // ==================== Gate 管理队列 ====================
+
+ @Bean
+ public DirectExchange gateExchange() {
+ return new DirectExchange(EXCHANGE_GATE);
+ }
+
+ @Bean
+ public Queue gateHeartbeatQueue() {
+ return new Queue(QUEUE_GATE_HEARTBEAT, true);
+ }
+
+ @Bean
+ public Binding bindingGateHeartbeat() {
+ return BindingBuilder.bind(gateHeartbeatQueue()).to(gateExchange()).with(ROUTINGKEY_GATE_HEARTBEAT);
+ }
+
+ @Bean
+ public Queue gateStatsQueue() {
+ return new Queue(QUEUE_GATE_STATS, true);
+ }
+
+ @Bean
+ public Binding bindingGateStats() {
+ return BindingBuilder.bind(gateStatsQueue()).to(gateExchange()).with(ROUTINGKEY_GATE_STATS);
+ }
+
}
--
Gitblit v1.9.1