Skip to content

Commit

Permalink
refactor ChatController.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik-gif committed Oct 25, 2024
1 parent 098886f commit ab0ad37
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ public MessageResponseDto sendMessage(@DestinationVariable UUID topicId, Message

log.info("Received message for topic ID: {}", topicId);

MessageResponseDto sendMessage = messageService.sendToTopic(topicId, message);
log.info("Message was saved in DB");

messagingTemplate.convertAndSend("/topic/public/" + topicId, message);
log.info("Message sent to topic ID: {}", topicId) ;

return sendMessage;
return messageService.sendToTopic(topicId, message);
}
}

0 comments on commit ab0ad37

Please sign in to comment.