| | |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "app", name = "quant", havingValue = "true") |
| | | @ConditionalOnProperty(prefix = "app", name = "websocket", havingValue = "true") |
| | | public class OkxNewPriceWebSocketClient { |
| | | @Resource |
| | | private WebsocketPriceService websocketPriceService; |
| | |
| | | } |
| | | private static final String WS_URL_MONIPAN = "wss://wspap.okx.com:8443/ws/v5/public"; |
| | | private static final String WS_URL_SHIPAN = "wss://ws.okx.com:8443/ws/v5/public"; |
| | | private static final boolean isAccountType = true; |
| | | private static final boolean isAccountType = false; |
| | | |
| | | /** |
| | | * 建立与 OKX WebSocket 服务器的连接。 |
| | |
| | | */ |
| | | private void reconnectWithBackoff() throws InterruptedException { |
| | | int attempt = 0; |
| | | int maxAttempts = 5; |
| | | int maxAttempts = 3; |
| | | long delayMs = 5000; |
| | | |
| | | while (attempt < maxAttempts) { |