SpringBoot
-
[Spring Boot] 채팅방에서 사용자가 업로드한 파일을 NHN Cloud의 Object Storage를 통해 관리하기SpringBoot 2024. 2. 7. 01:53
파일 업로드, 삭제, 다운로드 코드 작성 아래 NHN Cloud API 가이드에서 목차를 보면, 오브젝트 부분에 업로드 / 다운로드 / 복사 / 삭제등에 대한 작성법이 자세히 나와있다. API 가이드 - NHN Cloud 사용자 가이드 Storage > Object Storage > API 가이드 사전 준비 오브젝트 스토리지 API를 사용하려면 먼저 인증 토큰(token)을 발급 받아야 합니다. 인증 토큰은 오브젝트 스토리지의 REST API를 사용할 때 필요한 인증 키 docs.nhncloud.com 가이드에서는 RestTemplate을 사용하여 설명해주고 있는데 나의 경우 아래 업로드와 삭제 부분 코드를 보다시피 해당 부분에 대해서는 WebClient 방식으로 작성하였다. 다만 다운로드 부분은 작성하..
-
Spring-Data-DynamoDB를 사용하여 SpringBoot와 AWS DynamoDB 연동하기SpringBoot 2024. 1. 28. 23:39
들어가며 현재 진행하고 있는 실시간 채팅방 관련 프로젝트에서 채팅방에서 나눈 이전 대화들을 저장하여 사용자가 다시 채팅방에 접속하면 이전 대화 내용들을 보여주는 기능을 추가적으로 구현해야 했다. 이를 위해서는 채팅방 메시지들을 저장하고 조회, 삭제를 수행하게 될 데이터베이스를 무엇을 사용해야 할지 선택해야 했다. 💁♂️ RDB...? 아니면 NoSQL?? 💁♂️ 기존 데이터베이스는 RDB인 MySQL을 사용하고 있었는데, 원래 사용하던 MySQL을 사용할지 아니면 채팅방 메시지 관리를 위한 추가적인 NoSQL DB를 사용할지에 대한 고민이 깊어졌다. 그러나 NoSQL이 기존의 RDB보다 더 빠른 읽기 쓰기 성능을 가지고 있기 때문에, 각 채팅방 별, 채팅 내용을 저장하고 불러오기에는 NoSQL을 추가..
-
SpringBoot와 Kafka 연동 간의 SASL을 사용한 암호화 적용하기SpringBoot 2024. 1. 19. 00:44
최근에 카프카에 SASL 인증 방식을 적용한 상태여서 기존 스프링부트와 카프카 간의 연동에 더해서 스프링부트에 SASL 인증과 관련된 추가적인 설정이 필요하다. 이번에는 해당 설정들에 대해서 기록을 해보고자 한다. https://kjungw1025.tistory.com/27 Docker compose로 올린 Kafka에 ACL, SASL/PLAIN 인증 설정하기 들어가며 기본적으로 카프카는 어느 누구나 클러스터에 접근하여 메시지를 생성하거나 읽을 수 있다. 이로인해 보안이 적용되지 않은 상태에서는 데이터의 무단 액세스와 무단 조작이 가능하 kjungw1025.tistory.com 참고로 스프링부트와 카프카 연동하는 방법으로는 application.yml에 간단하게 관련 설정을 하는 방법과 직접 Produ..
-
[Spring Boot] 엑셀(xlsx) 파일 파싱 후, 서비스 로직에 추가하는 코드 작성하기SpringBoot 2023. 12. 21. 12:09
📖 발단교내에서 진행하는 캠퍼스SW아카데미인 TABA 프로젝트 기간에 발생했던 내용들을 기록하고자 한다. 우리팀의 경우 이미지 인식 AI를 활용한 두피 관리 서비스를 주제로 개발을 진행했었다.아래 사진과 같이 사용자의 두피 사진을 통해 6가지 증상을 측정하는데,6가지 증상에 대한 사용자의 두피 점수와 성별 및 같은 나이대에 대한 평균 값과 비교하여한눈에 보기 쉽게끔 육각형 그래프로 나타내고자 했었다. 프론트에서 이러한 육각형 그래프를 그리기 위해서는백엔드에서 사용자의 성별과 나이대에 맞는 평균 값을 보내줘야했다.해당 값들은 AI 파트를 맡은 팀원이, 추출한 값들을 엑셀(xlsx) 파일로 보내줬고이를 스프링부트에서 파싱하여 프론트에 값들을 보내도록 구현했다. 아래 사진은 해당 엑셀 파일의 일부로,..