| | |
| | | package com.xcong.excoin.modules.okxNewPrice; |
| | | |
| | | import com.xcong.excoin.modules.okxNewPrice.celue.CaoZuoServiceImpl; |
| | | import com.xcong.excoin.modules.okxNewPrice.wangge.WangGeServiceImpl; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.support.ClassPathXmlApplicationContext; |
| | | |
| | | public class OkxWebSocketClientMain { |
| | | public static void main(String[] args) throws InterruptedException { |
| | | OkxQuantWebSocketClient clientV2 = new OkxQuantWebSocketClient(); |
| | | // 手动调用初始化方法 |
| | | clientV2.init(); |
| | | // 使用Spring上下文初始化管理器 |
| | | ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); |
| | | OkxWebSocketClientManager manager = context.getBean(OkxWebSocketClientManager.class); |
| | | |
| | | // 运行一段时间以观察结果 |
| | | Thread.sleep(1200000000L); // 运行一小时 |
| | | |
| | | // 关闭连接 |
| | | clientV2.destroy(); |
| | | |
| | | manager.destroy(); |
| | | } |
| | | } |