From 36be00e0f3cbe0d559c646fd2977e6e3a74aa6f9 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Mon, 30 Sep 2024 16:57:22 +0800
Subject: [PATCH] Merge branch 'bea' of http://120.27.238.55:7000/r/exchange into bea

---
 src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java |  485 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 484 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java b/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
index eec7531..bedc53d 100644
--- a/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
+++ b/src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
@@ -21,11 +21,123 @@
 @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 = "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_USDT_ADDRESS = "exchange_usdt_address";
+
+    public static final String QUEUE_USDT_ADDRESS= "queue_usdt_address";
+
+    public static final String ROUTING_KEY_USDT_ADDRESS = "routing_key_usdt_address";
+
+
+    /**
+     * 撮合交易
+     */
+    public static final String EXCHANGE_B = "biue-exchange-B";
+
+
+    // 开多止盈队列
+    public static final String QUEUE_MOREPRO = "QUEUE_MOREPRO_NEW";
+    // 开空止盈队列
+    public static final String QUEUE_LESSPRO = "QUEUE_LESSPRO_NEW";
+    // 开多止损队列
+    public static final String QUEUE_MORELOSS = "QUEUE_MORELOSS_NEW";
+    // 开空止损队列
+    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_NEW";
+
+    //价格操作
+    public static final String QUEUE_PRICEOPERATE = "QUEUE_PRICEOPERATE_NEW";
+
+    // 平仓队列
+    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";
+
+
+    // 开多止盈路由键
+    public static final String ROUTINGKEY_MOREPRO = "ROUTINGKEY_MOREPRO";
+    // 开空止盈路由
+    public static final String ROUTINGKEY_LESSPRO = "ROUTINGKEY_LESSPRO";
+    // 开多止损路由
+    public static final String ROUTINGKEY_MORELOSS = "ROUTINGKEY_MORELOSS";
+    // 开空止损路由
+    public static final String ROUTINGKEY_LESSLOSS = "ROUTINGKEY_LESSLOSS";
+    // 限价委托
+    public static final String ROUTINGKEY_LIMIT = "ROUTINGKEY_LIMIT";
+
+    // 爆仓路由
+    public static final String ROUTINGKEY_COINOUT = "ROUTINGKEY_COINOUT";
+
+
+    // 价格操作
+    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";
+
+    public static final String EXCHANGE_ROC_ORDER_SUBMIT = "roc-exchange-order-submit";
+
+    public static final String QUEUE_ROC_ORDER_SUBMIT = "roc-order-queue-submit";
+
+    public static final String ROUTING_KEY_ROC_ORDER_SUBMIT  = "roc-order-routingKey-submit";
+
+    public static final String EXCHANGE_ROC_ORDER_CANCEL = "roc-exchange-order-cancel";
+
+    public static final String QUEUE_ROC_ORDER_CANCEL = "roc-order-queue-cancel";
+
+    public static final String ROUTING_KEY_ROC_ORDER_CANCEL  = "roc-order-routingKey-cancel";
+
+    public static final String EXCHANGE_ROC_ORDER_COMPLETE = "roc-exchange-order-complete";
+
+    public static final String QUEUE_ROC_ORDER_COMPLETE = "roc-order-queue-complete";
+
+    public static final String ROUTING_KEY_ROC_ORDER_COMPLETE  = "roc-order-routingKey-complete";
+
+    public static final String QUEUE_TRC20_BLOCK = "QUEUE_TRC20_BLOCK";
+    public static final String ROUTING_TRC20_BLOCK = "ROUTING_TRC20_BLOCK";
+
+    public static final String QUEUE_MSG_HISTORY = "queue_msg_history";
+    public static final String ROUTING_KEY_MSG_HISTORY = "routing_key_msg_history";
+
+    public static final String ROUTINGKEY_MARKET_BUSSINESS = "ROUTINGKEY_MARKET_BUSSINESS";
+    public static final String QUEUE_MARKET_BUSSINESS = "QUEUE_MARKET_BUSSINESS";
+
+    public static final String QUEUE_ORDER_RETURN = "QUEUE_ORDER_RETURN";
+    public static final String ROUTING_ORDER_RETURN = "ROUTING_ORDER_RETURN";
 
     @Resource
     private ConnectionFactory connectionFactory;
@@ -39,6 +151,39 @@
 //        return connectionFactory;
 //    }
 
+    // ========= otc start =============
+    @Bean
+    public Queue orderReturnQueue() {
+        return new Queue(QUEUE_ORDER_RETURN);
+    }
+
+    @Bean
+    public Binding orderReturnBinding() {
+        return BindingBuilder.bind(orderReturnQueue()).to(defaultExchange()).with(ROUTING_ORDER_RETURN);
+    }
+
+    @Bean
+    public Queue marketBussinessQueue() {
+        return new Queue(QUEUE_MARKET_BUSSINESS);
+    }
+
+    @Bean
+    public Binding marketBussinessBinding() {
+        return BindingBuilder.bind(marketBussinessQueue()).to(defaultExchange()).with(ROUTINGKEY_MARKET_BUSSINESS);
+    }
+
+    @Bean
+    public Queue msgHistoryQueue() {
+        return new Queue(QUEUE_MSG_HISTORY);
+    }
+
+    @Bean
+    public Binding msgHistoryBinding() {
+        return BindingBuilder.bind(msgHistoryQueue()).to(defaultExchange()).with(ROUTING_KEY_MSG_HISTORY);
+    }
+    // ========= otc end =============
+
+
     @Bean
     @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
     public RabbitTemplate rabbitTemplate() {
@@ -50,6 +195,7 @@
         return new DirectExchange(EXCHANGE_ONE);
     }
 
+
     @Bean
     public Queue testQueue() {
         return new Queue(QUEUE_TEST, true);
@@ -60,4 +206,341 @@
         return BindingBuilder.bind(testQueue()).to(defaultExchange()).with(ROUTING_KEY_TEST);
     }
 
+    // 交易订单
+    @Bean
+    public DirectExchange orderSubmitExchange() {
+        return new DirectExchange(EXCHANGE_ROC_ORDER_SUBMIT);
+    }
+
+
+    @Bean
+    public Queue ordereSubmitQueue() {
+        return new Queue(QUEUE_ROC_ORDER_SUBMIT, true);
+    }
+
+    @Bean
+    public Binding bindingSubmitOrder() {
+        return BindingBuilder.bind(ordereSubmitQueue()).to(orderSubmitExchange()).with(ROUTING_KEY_ROC_ORDER_SUBMIT);
+    }
+
+    // 交易订单
+    @Bean
+    public DirectExchange orderCancelExchange() {
+        return new DirectExchange(EXCHANGE_ROC_ORDER_CANCEL);
+    }
+
+
+    @Bean
+    public Queue ordereCancelQueue() {
+        return new Queue(QUEUE_ROC_ORDER_CANCEL, true);
+    }
+
+    @Bean
+    public Binding bindingCancelOrder() {
+        return BindingBuilder.bind(ordereCancelQueue()).to(orderCancelExchange()).with(ROUTING_KEY_ROC_ORDER_CANCEL);
+    }
+   // 交易订单
+    @Bean
+    public DirectExchange orderCompleteExchange() {
+        return new DirectExchange(EXCHANGE_ROC_ORDER_COMPLETE);
+    }
+
+
+    @Bean
+    public Queue ordereCompleteQueue() {
+        return new Queue(QUEUE_ROC_ORDER_COMPLETE, true);
+    }
+
+    @Bean
+    public Binding bindingCompleteOrder() {
+        return BindingBuilder.bind(ordereCompleteQueue()).to(orderCompleteExchange()).with(ROUTING_KEY_ROC_ORDER_COMPLETE);
+    }
+
+
+   @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);
+    }
+
+    @Bean
+    public DirectExchange usdtAddressExchange() {
+        return new DirectExchange(EXCHANGE_USDT_ADDRESS);
+    }
+
+
+    @Bean
+    public Queue usdtAddressQueue() {
+        return new Queue(QUEUE_USDT_ADDRESS, true);
+    }
+
+    @Bean
+    public Binding usdtAddressbinding() {
+        return BindingBuilder.bind(usdtAddressQueue()).to(usdtAddressExchange()).with(ROUTING_KEY_USDT_ADDRESS);
+    }
+
+    @Bean
+    public Queue trc20Queue() {
+        return new Queue(QUEUE_TRC20_BLOCK);
+    }
+
+    @Bean
+    public Binding trc20Binding() {
+        return BindingBuilder.bind(trc20Queue()).to(defaultExchange()).with(ROUTING_TRC20_BLOCK);
+    }
+
+
+    /**
+     * 交换器A 可以继续添加交换器B C
+     *
+     * @return
+     */
+    @Bean
+    public DirectExchange orderExchange() {
+        return new DirectExchange(EXCHANGE_A);
+    }
+
+
+    /**
+     * 开多止盈队列
+     *
+     * @return
+     */
+    @Bean
+    public Queue queueMorePro() {
+        // 定义一个名称为QUEUE_A,持久化的队列
+        return new Queue(QUEUE_MOREPRO, true);
+    }
+
+    /**
+     * 开空止盈队列
+     *
+     * @return
+     */
+    @Bean
+    public Queue queueLessPro() {
+        // 定义一个名称为QUEUE_A,持久化的队列
+        return new Queue(QUEUE_LESSPRO, true);
+    }
+
+    /**
+     * 开多止损
+     *
+     * @return
+     */
+    @Bean
+    public Queue queueMoreLoss() {
+        // 定义一个名称为QUEUE_A,持久化的队列
+        return new Queue(QUEUE_MORELOSS, true);
+    }
+
+    /**
+     * 开空止损
+     *
+     * @return
+     */
+    @Bean
+    public Queue queueLessLoss() {
+        // 定义一个名称为QUEUE_A,持久化的队列
+        return new Queue(QUEUE_LESSLOSS, true);
+    }
+
+    /**
+     * 限价委托
+     *
+     * @return
+     */
+    @Bean
+    public Queue queueLimit() {
+        return new Queue(QUEUE_LIMIT, true);
+    }
+
+
+    /**
+     * 爆仓
+     *
+     * @return
+     */
+    @Bean
+    public Queue queueCoinout() {
+        return new Queue(QUEUE_COINOUT, true);
+    }
+
+    /**
+     * 价格操作
+     *
+     * @return
+     */
+    @Bean
+    public Queue queuePriceoperate() {
+        return new Queue(QUEUE_PRICEOPERATE, true);
+    }
+
+    /**
+     * 价格操作
+     *
+     * @return
+     */
+    @Bean
+    public Queue queueCloseTrade() {
+        return new Queue(QUEUE_CLOSETRADE, true);
+    }
+
+
+    /**
+     * 盘口推送
+     *
+     * @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
+    public Binding bindingMroPro() {
+        return BindingBuilder.bind(queueMorePro()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_MOREPRO);
+    }
+
+    /**
+     * 开空止盈
+     *
+     * @return
+     */
+    @Bean
+    public Binding bindingLessPro() {
+        return BindingBuilder.bind(queueLessPro()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_LESSPRO);
+    }
+
+    /**
+     * 开多止损
+     *
+     * @return
+     */
+    @Bean
+    public Binding bindingMroLoss() {
+        return BindingBuilder.bind(queueMoreLoss()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_MORELOSS);
+    }
+
+    /**
+     * 开空止损
+     *
+     * @return
+     */
+    @Bean
+    public Binding bindingLessLoss() {
+        return BindingBuilder.bind(queueLessLoss()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_LESSLOSS);
+    }
+
+
+    /**
+     * 委托
+     *
+     * @return
+     */
+    @Bean
+    public Binding bindingLimit() {
+        return BindingBuilder.bind(queueLimit()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_LIMIT);
+    }
+
+
+    /**
+     * 爆仓
+     *
+     * @return
+     */
+    @Bean
+    public Binding bindingCoinout() {
+        return BindingBuilder.bind(queueCoinout()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_COINOUT);
+    }
+
+
+    /**
+     * 价格操作
+     *
+     * @return
+     */
+    @Bean
+    public Binding bindingPriceoperate() {
+        return BindingBuilder.bind(queuePriceoperate()).to(orderExchange()).with(RabbitMqConfig.ROUTINGKEY_PRICEOPERATE);
+    }
+
+    /**
+     * 平仓绑定
+     *
+     * @return
+     */
+    @Bean
+    public Binding bindingCloseTrade() {
+        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