From bc489f2d0ac40d23260d961f7eb43634b8a69fea Mon Sep 17 00:00:00 2001
From: zainali5120 <512061637@qq.com>
Date: Fri, 09 Oct 2020 17:44:04 +0800
Subject: [PATCH] 成交记录和帮助中心
---
src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java | 146 +++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 136 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java b/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
index 7be7a45..501d615 100644
--- a/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
+++ b/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
@@ -21,36 +21,54 @@
@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 EXCHANGE_USDT_UPDATE = "exchange_usdt_update";
+
+ public static final String QUEUE_USDT_UPDATE = "queue_usdt_update";
+
+ public static final String ROUTING_KEY_USDT_UPDATE = "routing_key_usdt_update";
+
+
+ /**
+ * 撮合交易
+ */
+ public static final String EXCHANGE_B = "biue-exchange-B";
// 开多止盈队列
- 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_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";
+ // 盘口队列
+ public static final String QUEUE_TRADE_PLATE = "QUEUE_TRADE_PLATE";
+
+ // 处理交易
+ public static final String QUEUE_HANDLE_TRADE = "QUEUE_HANDLE_TRADE";
// 开多止盈路由键
@@ -72,6 +90,19 @@
public static final String ROUTINGKEY_PRICEOPERATE = "ROUTINGKEY_PRICEOPERATE";
// 平仓路由
public static final String ROUTINGKEY_CLOSETRADE = "ROUTINGKEY_CLOSETRADE";
+
+ // 盘口理路由
+ public static final String ROUTINGKEY_TRADE_PLATE = "ROUTINGKEY_TRADE_PLATE";
+
+ // 交易订单处理
+ public static final String ROUTINGKEY_HANDLE_TRADE = "ROUTINGKEY_HANDLE_TRADE";
+
+ public static final String EXCHANGE_ROC = "roc-transfer";
+
+ public static final String QUEUE_ROC= "roc-queue";
+
+ public static final String ROUTING_KEY_ROC = "roc-transfer-routingKey";
+
@Resource
private ConnectionFactory connectionFactory;
@@ -96,6 +127,7 @@
return new DirectExchange(EXCHANGE_ONE);
}
+
@Bean
public Queue testQueue() {
return new Queue(QUEUE_TEST, true);
@@ -104,6 +136,23 @@
@Bean
public Binding binding() {
return BindingBuilder.bind(testQueue()).to(defaultExchange()).with(ROUTING_KEY_TEST);
+ }
+
+
+ @Bean
+ public DirectExchange usdtUpdateExchange() {
+ return new DirectExchange(EXCHANGE_USDT_UPDATE);
+ }
+
+
+ @Bean
+ public Queue usdtUpdateQueue() {
+ return new Queue(QUEUE_USDT_UPDATE, true);
+ }
+
+ @Bean
+ public Binding usdtUpdatebinding() {
+ return BindingBuilder.bind(usdtUpdateQueue()).to(usdtUpdateExchange()).with(ROUTING_KEY_USDT_UPDATE);
}
@@ -118,9 +167,9 @@
}
-
/**
* 开多止盈队列
+ *
* @return
*/
@Bean
@@ -131,6 +180,7 @@
/**
* 开空止盈队列
+ *
* @return
*/
@Bean
@@ -141,6 +191,7 @@
/**
* 开多止损
+ *
* @return
*/
@Bean
@@ -151,6 +202,7 @@
/**
* 开空止损
+ *
* @return
*/
@Bean
@@ -161,6 +213,7 @@
/**
* 限价委托
+ *
* @return
*/
@Bean
@@ -171,6 +224,7 @@
/**
* 爆仓
+ *
* @return
*/
@Bean
@@ -180,6 +234,7 @@
/**
* 价格操作
+ *
* @return
*/
@Bean
@@ -189,6 +244,7 @@
/**
* 价格操作
+ *
* @return
*/
@Bean
@@ -197,9 +253,30 @@
}
+ /**
+ * 盘口推送
+ *
+ * @return
+ */
+ @Bean
+ public Queue queuePlateTrade() {
+ return new Queue(QUEUE_TRADE_PLATE, true);
+ }
+
+ /**
+ * 交易订单处理
+ *
+ * @return
+ */
+ @Bean
+ public Queue queueHandleTrade() {
+ return new Queue(QUEUE_HANDLE_TRADE, true);
+ }
+
/**
* 开多止盈
+ *
* @return
*/
@Bean
@@ -209,6 +286,7 @@
/**
* 开空止盈
+ *
* @return
*/
@Bean
@@ -218,6 +296,7 @@
/**
* 开多止损
+ *
* @return
*/
@Bean
@@ -227,6 +306,7 @@
/**
* 开空止损
+ *
* @return
*/
@Bean
@@ -237,6 +317,7 @@
/**
* 委托
+ *
* @return
*/
@Bean
@@ -247,6 +328,7 @@
/**
* 爆仓
+ *
* @return
*/
@Bean
@@ -257,6 +339,7 @@
/**
* 价格操作
+ *
* @return
*/
@Bean
@@ -266,6 +349,7 @@
/**
* 平仓绑定
+ *
* @return
*/
@Bean
@@ -273,4 +357,46 @@
return BindingBuilder.bind(queueCloseTrade()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_CLOSETRADE);
}
+
+ @Bean
+ public DirectExchange matchTradeExchange() {
+ return new DirectExchange(EXCHANGE_B);
+ }
+
+ /**
+ * 盘口变化绑定
+ *
+ * @return
+ */
+ @Bean
+ public Binding bindingPlateTrade() {
+ return BindingBuilder.bind(queuePlateTrade()).to(matchTradeExchange()).with(RabbitMqConfig.ROUTINGKEY_TRADE_PLATE);
+ }
+
+ /**
+ * 交易订单处理
+ *
+ * @return
+ */
+ @Bean
+ public Binding bindingHandleTrade() {
+ return BindingBuilder.bind(queueHandleTrade()).to(matchTradeExchange()).with(RabbitMqConfig.ROUTINGKEY_HANDLE_TRADE);
+ }
+
+ @Bean
+ public DirectExchange rocExchange() {
+ return new DirectExchange(EXCHANGE_ROC);
+ }
+
+
+ @Bean
+ public Queue rocQueue() {
+ return new Queue(QUEUE_ROC, true);
+ }
+
+ @Bean
+ public Binding bindingRoc() {
+ return BindingBuilder.bind(rocQueue()).to(rocExchange()).with(ROUTING_KEY_ROC);
+ }
+
}
--
Gitblit v1.9.1