• kafka 요청 ← authorUuid (request)

  • 구독 신청 (save - rdb)

  • kafka 전송 ← authorUuid, subscriberList (response)

  • common 폴더 내에 Exception과 Response에 관한 파일 생성

    • config에 대해서는 swagger만 설정
    • kafka에 대해서는 Producer와 Consumer에 대한 Config를 추후 생성할 예정
  • SwaggerConfig 추가 (subscribe-service 명으로 라우터에 전달)

  • subscribe 엔티티에 대해서 아래와 같음

    @Entity
    @Getter
    @NoArgsConstructor
    public class Subscribe {
    	@Id
    	@GeneratedValue(strategy = GenerationType.IDENTITY)
    	private Long id;
    
    	@Column(nullable = false)
    	private String authorUuid;
    
    	@Column(nullable = false, unique = true)
    	private String subscriberUuid;
    
    }
    
    • 이에 대한 dto / vo 생성하였고, create의 경우는 서비스 내에서 자체적으로 처리 가능하지만 read에 대해서는 분류
    • 피드 서비스에서 post api 발생 시점에 kafka를 통하여 authorUuid를 받고, 그 값에 대해 subscriberUuids 를 조회하여 dto에 값을 생성하여 이를 kafka를 통해 알림 서비스에 전달할 예정
    • Q1. 장애전파가 될 수 밖에 없는 구조 → X
    • Q2. vo를 service 로직에서 바로 받고 “ 피드requestDto→알림requestDto “ Listener class