|
|
@ -43,7 +43,7 @@ public class InteractiveSessionManager { |
|
|
|
public static Map.Entry<String, WebSocketSession> getEntryBySession(WebSocketSession session) { |
|
|
|
public static Map.Entry<String, WebSocketSession> getEntryBySession(WebSocketSession session) { |
|
|
|
Set<Map.Entry<String, WebSocketSession>> sessionEntrySet = InteractiveSessionManager.SESSION_POOL.entrySet(); |
|
|
|
Set<Map.Entry<String, WebSocketSession>> sessionEntrySet = InteractiveSessionManager.SESSION_POOL.entrySet(); |
|
|
|
Optional<Map.Entry<String, WebSocketSession>> sessionIdOptional = sessionEntrySet.stream().filter(sessionEntry -> session.equals(sessionEntry.getValue())).findFirst(); |
|
|
|
Optional<Map.Entry<String, WebSocketSession>> sessionIdOptional = sessionEntrySet.stream().filter(sessionEntry -> session.equals(sessionEntry.getValue())).findFirst(); |
|
|
|
if(sessionIdOptional.isPresent()) { |
|
|
|
if(!sessionIdOptional.isPresent()) { |
|
|
|
log.error("当前Session Pool未查询到相关session,消息推送失败"); |
|
|
|
log.error("当前Session Pool未查询到相关session,消息推送失败"); |
|
|
|
throw new ServiceException("当前Session Pool未查询到相关session,消息推送失败"); |
|
|
|
throw new ServiceException("当前Session Pool未查询到相关session,消息推送失败"); |
|
|
|
} |
|
|
|
} |
|
|
|