Skip to content

Commit

Permalink
[HOTFIX] Fix: log 구체화
Browse files Browse the repository at this point in the history
  • Loading branch information
tjdgns8439 committed Sep 3, 2024
1 parent 43cb31c commit 50e34fc
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import com.modutaxi.api.common.exception.errorcode.StompErrorCode;
import com.modutaxi.api.domain.chatmessage.dto.ChatMessageResponseDto.ChatMessageResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.simp.SimpMessageSendingOperations;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class RedisSubscriber {
Expand All @@ -20,8 +22,17 @@ public void sendMessage(String publishMessage) {
try {
ChatMessageResponse chatMessageResponse;
chatMessageResponse = objectMapper.readValue(publishMessage, ChatMessageResponse.class);

// Log each field of ChatMessageResponse
log.info("Room ID: {}", chatMessageResponse.getRoomId());
log.info("Message Type: {}", chatMessageResponse.getMessageType());
log.info("Content: {}", chatMessageResponse.getContent());
log.info("Sender: {}", chatMessageResponse.getSender());
log.info("Member ID: {}", chatMessageResponse.getMemberId());
log.info("Date and Time: {}", chatMessageResponse.getDateTime());

messageSendingOperations.convertAndSend("/sub/chat/" + chatMessageResponse.getRoomId(),
chatMessageResponse);
chatMessageResponse);
} catch (JsonProcessingException e) {
throw new BaseException(StompErrorCode.FAIL_SEND_MESSAGE);
}
Expand Down

0 comments on commit 50e34fc

Please sign in to comment.