| | |
| | | |
| | | 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 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; |
| | |
| | | // connectionFactory.setPublisherConfirmType(CachingConnectionFactory.ConfirmType.CORRELATED); |
| | | // 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 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 |
| | |
| | | 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 |