본문 바로가기

전체 글72

카프카 토픽 삭제할 때 문제 현재 아마 zookeeper와 kafka 만 킨것 같다 커넥트까지 킨지는 모르겠음... 현재 기존에 있던 orders와 my_topic_users 토픽을 삭제하려고한다. /c/Work/Kafka-practice/kafka 위치에서 $ ./bin/windows/kafka-topics.bat --bootstrap-server localhost:9092 --list 명령어로 토픽이름 확인하니까 잘나옴 __consumer_offsets connect-configs connect-offsets connect-status example-catalog-topic my_topic_users orders /c/Work/Kafka-practice/kafka 위치에서 $ ./bin/windows/kafka-topics.ba.. 2022. 9. 6.
카프카 커넥트 실행 오류 [Failed to find any class that implements Connector and which name matches io.confluent.connect.jdbc.JdbcSourceConnector, available connectors are] 주키퍼와 카프카를 실행시키고 카프카 커넥트를 실행시켰는데 이 상태에서 $ ./bin/windows/connect-distributed.bat ./etc/kafka/connect-distributed.properties log4j:WARN No appenders could be found for logger (org.apache.kafka.connect.runtime.WorkerInfo). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 9▒▒ 01, 2022 1:15:35 ▒▒▒▒ org.glassfish.. 2022. 9. 1.
카프카 커넥트 설치 및 설정하기(Windows) 카프카 커넥트에 대해서 알아보고 설치하고 설정하는 방법을 알아보자 카프카 커넥트란 카프카 커넥트는 아파치 카프카와 다른 Data System간에 확장가능하고 안정적인 데이터 스트리밍을 위한 도구이다. 원래는 카프카에 데이터를 PUB하기 위해서는 프로듀서와 컨슈머가 필요했다 DB에 있는 데이터를 카프카로 Pub하는 프로듀서와 카프카의 데이터를 Sub하는 컨슈머가 있었다. 그런데 통합해야하는 DB가 100개가 있는 회사라면? 프로듀서도 100개가 개발 되어야 하고 컨슈머도 100개가 개발되어야 할것이다. 100개를 개발하는 비용도 많많치 않을테고 전부 DB이기 때문에 로직의 반복도 많을 것이다. 더 간편하게 효율적으로 데이터파이프라인을 구축하는 방법으로 Kafka Connect가 나온 것이다 Kafka Co.. 2022. 9. 1.
Spring Cloud Bus Spring Cloud Bus 는 분산 시스템 환경, 마이크로서비스 환경에서 각각의 노드나 서비스를 연결시켜주는 경량 메시지 브로커이다. 또는 Spring cloud bus는 동적으로 config 변경을 적용하기 위한 MQ(Message Queue) Handler이다. config가 변경되면 각 마이크로서비스는 최신 값을 갖고 오기 위해 POST로 http[s]://{microservice host}/actuator/refresh를 해줘야 한다. 이 작업을 자동화할 수도 있으나, config server가 각 마이크로서비스의 주소를 모두 관리해야 하니 비효율적이다. 즉, actuator refresh 기능은 매 어플리케이션 서비스마다 각각 실행 시켜줘야해서 불편한데 스프링 클라우드 버스 기능으로 한 번에.. 2022. 8. 30.
io.jsonwebtoken.SignatureException: JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted. 에러 해결 마이크로서비스(user-service)와 apigateway 서비스를 사용하던중에 RestTemplate 을 적용하고 api 요청을 테스트하는데 user-service를 apigateway 서비스에 등록한데로 get방식이 요청안됐다. apigateway-service의 application.yml에 get방식은 AuthorizationHeaderFilter를 거치도록 등록해놨다. spring: application: name: apigateway-service rabbitmq: host: 127.0.0.1 port: 5672 username: guest password: guest cloud: gateway: default-filters: - name: GlobalFilter # GlobalFilter .. 2022. 8. 30.
@Builder 상속하기 Item 클래스를 상속받은 Book 클래스가 있다 Book 클래스에서 Builder를 사용하면 Book 클래스에 있는 값을 builder로 정의할 수 있는데 상속할 Item 클래스는 추가적인 작업이 필요하다. 우선 Book 클래스와 Item클래스를 살펴보자 @Entity @DiscriminatorValue("B") // 싱글 테이블이기 때문에 db에 저장할 때 구분해야한다. @Getter public class Book extends Item{ private String author; private String isbn; } @Entity // 상속관계 매핑은 상속관계 전략을 지정해야한다. 이 전략을 부모클래스에 입력해야한다. @Inheritance(strategy = InheritanceType.SIN.. 2022. 8. 24.