SpringBoot와 Kafka 연동 간의 SASL을 사용한 암호화 적용하기
·
SpringBoot
최근에 카프카에 SASL 인증 방식을 적용한 상태여서기존 스프링부트와 카프카 간의 연동에 더해서 스프링부트에 SASL 인증과 관련된 추가적인 설정이 필요하다.이번에는 해당 설정들에 대해서 기록을 해보고자 한다.https://kjungw1025.tistory.com/27 Docker compose로 올린 Kafka에 ACL, SASL/PLAIN 인증 설정하기들어가며 기본적으로 카프카는 어느 누구나 클러스터에 접근하여 메시지를 생성하거나 읽을 수 있다. 이로인해 보안이 적용되지 않은 상태에서는 데이터의 무단 액세스와 무단 조작이 가능하kjungw1025.tistory.com  참고로 스프링부트와 카프카 연동하는 방법으로는 application.yml에 간단하게 관련 설정을 하는 방법과직접 ProducerFa..
Docker compose로 올린 Kafka에 ACL, SASL/PLAIN 인증 설정하기
·
Apache Kafka/보안
들어가며기본적으로 카프카는 어느 누구나 클러스터에 접근하여 메시지를 생성하거나 읽을 수 있다.이로인해 보안이 적용되지 않은 상태에서는 데이터의 무단 액세스와 무단 조작이 가능하므로, 중요한 정보를 다루는 시스템에서는 보안을 강화하는 것이 중요하다. 그러므로 카프카에 누가 요청을 보내고, 그 요청자의 권한에 따라서 요청 범위를 제한하는카프카 인증, 인가에 대해서 알아보고 직접 적용해보고자 한다.   개념 카프카 인증카프카에서 인증을 처리하는 방식으로 SSL 방식과 SASL 방식으로, 크게 두 가지 방식이 존재한다.SSL : 인증서를 활용한 인증 방식데이터를 암호화하고 통신 채널을 안전하게 유지하여 중간에서의 데이터 탈취나 변조를 방지한다.SASL : SASL 프로토콜을 이용한 인증 방식클라이언트가 카프카 ..
[LeetCode Hard] 601. Human Traffic of Stadium
·
SQL 문제 풀이
이번 문제는 개인적으로 많이 어려웠던 문제였다...ㅜ다른 사람들의 풀이를 보니 LEAD()와 LAG()를 이용한 문제 풀이가 있었는데솔직히 이번 문제를 풀면서 저런 함수가 있다는걸 처음 알았다꾸준히 복습하면서 내껄로 만들어야지... 테이블 정보  문제Write a solution to display the records with three or more rows with consecutive id's, and the number of people is greater than or equal to 100 for each. Return the result table ordered by visit_date in ascending order. The result format is in the following ..
Kafka Jsonserializer/JsonDeserializer 한글 처리 오류
·
Apache Kafka/오류 해결
문제 현재 스프링부트에서 STOMP를 활용한 채팅방을 구현하는 도중에 아래 오류를 해결한 후에 또 다른 오류를 직면하게 되었다. https://kjungw1025.tistory.com/24 SpringBoot와 Kafka 연동 시 발생한 ErrorHandlingDeserializer 관련 오류 문제 스프링부트에서 STOMP를 활용한 채팅방을 구현하기 위해 기존 In memory broker 방식에서 External broker 중 하나인 Kafka를 통해 아래 형태의 메시지를 전달하려는데, @Getter @NoArgsConstructor @ToString publi kjungw1025.tistory.com KafkaTemplate 부분을 보다시피 채팅방 메시지를 전달하기 위해서 value 값을 Messa..
SpringBoot와 Kafka 연동 시 발생한 ErrorHandlingDeserializer 관련 오류
·
Apache Kafka/오류 해결
문제스프링부트에서 STOMP를 활용한 채팅방을 구현하기 위해기존 In memory broker 방식에서 External broker 중 하나인 Kafka를 통해 아래 형태의 메시지를 전달하려는데, @Getter@NoArgsConstructor@ToStringpublic class Message { @NotNull private MessageType type; private String roomId; @NotNull private String sender; @NotNull private String message; @Builder private Message(MessageType type, String roomId, ..
SpringBoot와 Docker compose로 pull 받은 Kafka 연동 시 발생한 오류
·
Apache Kafka/오류 해결
문제 1현재 카프카의 경우, AWS LightSail 서버에 Docker로 올려둔 상황이며,로컬 환경에서의 스프링부트와 연동하고자 하는데 아래와 같은 문제가 발생했다.INFO 33496 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient : [Consumer clientId=consumer-chatting-1, groupId=chatting] Node 1001 disconnected.WARN 33496 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient : [Consumer clientId=consumer-chatting-1, groupId=chatting] Connection to ..
[Kafka 개념] Kafka 브로커, 클러스터, 주키퍼
·
Apache Kafka/개념 정리
카프카 브로커, 클러스터, 주키퍼 카프카 브로커는 카프카 클라이언트와 데이터를 주고받기 위해 사용하는 주체이자,데이터를 분산 저장하여 장애가 발생하더라도 안전하게 사용할 수 있도록 도와주는 애플리케이션이다.  기본적으로 하나의 서버에는 한 개의 카프카 브로커 프로세스가 실행되나,데이터를 안전하게 보관하고 처리하기 위해서는 3대 이상의 브로커 서버를 1개의 클러스터로 묶어서 운영하는 것이 좋다.  카프카 클러스터로 묶인 브로커들은 프로듀서가 보낸 데이터를 안전하게분산 저장하고 복제하는 역할을 수행한다.   브로커데이터 저장, 전송프로듀서로부터 데이터를 전달받으면 카프카 브로커는 프로듀서가 요청한 토픽의 파티션에 데이터를 저장하고컨슈머가 데이터를 요청하면 파티션에 저장된 데이터를 전달한다. 프로듀서로부터 전..
[LeetCode Medium] 1341. Movie Rating
·
SQL 문제 풀이
테이블 정보  문제Write a solution to:Find the name of the user who has rated the greatest number of movies. In case of a tie, return the lexicographically smaller user name.Find the movie name with the highest average rating in February 2020. In case of a tie, return the lexicographically smaller movie name.  결과 예시  정답 코드 (MySQL)(SELECT u.name AS resultsFROM Users uJOIN MovieRating mrON u.user_id = mr...
[LeetCode Hard] 185. Department Top Three Salaries
·
SQL 문제 풀이
테이블 정보 문제A company's executives are interested in seeing who earns the most money in each of the company's departments. A high earner in a department is an employee who has a salary in the top three unique salaries for that department.Write a solution to find the employees who are high earners in each of the departments. Return the result table in any order. The result format is in the following..
[LeetCode Medium] 550. Game Play Analysis IV
·
SQL 문제 풀이
테이블 정보 문제Write a solution to report the fraction of players that logged in again on the day after the day they first logged in, rounded to 2 decimal places. In other words, you need to count the number of players that logged in for at least two consecutive days starting from their first login date, then divide that number by the total number of players. 결과 예시  정답 코드 (MySQL)WITH check_login AS ( ..