| | |
| | | @Override |
| | | public void run() { |
| | | if (isOpen()) { |
| | | send(("key:"+ eStockType.getStockKey()+":"+eStockType.getContryId()).getBytes()); |
| | | //send(("key:"+ eStockType.getStockKey()+":"+eStockType.getContryId()).getBytes()); |
| | | send("heartbeat"); |
| | | } |
| | | |
| | | } |
| | |
| | | String json = objectMapper.writeValueAsString(stockRealTimeBean); |
| | | sendLoca(json); |
| | | StockRealTimeBean stockDetailBean = new Gson().fromJson(message, StockRealTimeBean.class); |
| | | System.out.println(stockDetailBean); |
| | | RedisKeyUtil.setCacheRealTimeStock(EStockType.US,stockDetailBean); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("websocket 美国股票 消息错误:{}", e.getMessage()); |