feat: add video websocket handler etc...
All checks were successful
dev middleware install / deploy (push) Successful in 12s
All checks were successful
dev middleware install / deploy (push) Successful in 12s
This commit is contained in:
@@ -8,16 +8,19 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import xin.merlin.myplayerbackend.config.RabbitMQConfig;
|
||||
import xin.merlin.myplayerbackend.utils.websocket.command.CommandDispatcher;
|
||||
import xin.merlin.myplayerbackend.utils.websocket.command.CommandDispatcherVideo;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class WebSocketMessageConsumer {
|
||||
|
||||
private final WebSocketSessionManager sessionManager;
|
||||
private final OnlineWebSocketSessionManager sessionManager;
|
||||
|
||||
private final CommandDispatcher commandDispatcher;
|
||||
|
||||
private final CommandDispatcherVideo commandDispatcherVideo;
|
||||
|
||||
@RabbitListener(queues = RabbitMQConfig.WS_MESSAGE_QUEUE)
|
||||
public void onMessage(String json) {
|
||||
try {
|
||||
@@ -33,8 +36,8 @@ public class WebSocketMessageConsumer {
|
||||
public void onVideoMessage(String json) {
|
||||
try {
|
||||
JSONObject msg = JSON.parseObject(json);
|
||||
commandDispatcher.dispatch(msg);
|
||||
|
||||
commandDispatcherVideo.dispatch(msg);
|
||||
System.out.println("sending video message");
|
||||
} catch (Exception e) {
|
||||
log.info(e.getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user