Skip to content

Self-injection 패턴 적용#153

Merged
leepg038292 merged 1 commit into
devfrom
verify-fcm-token
Nov 23, 2025
Merged

Self-injection 패턴 적용#153
leepg038292 merged 1 commit into
devfrom
verify-fcm-token

Conversation

@leepg038292
Copy link
Copy Markdown
Contributor

@leepg038292 leepg038292 commented Nov 23, 2025

#️⃣ 연관 이슈

ex) #이슈번호

PR 타입(하나 이상의 PR 타입을 선택해주세요)

  • 기능 추가
  • 기능 삭제
  • 버그 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트

이번 PR에서 작업한 내용을 간략히 설명해주세요

1차 원인: 트랜잭션 누락

2차 원인: Spring AOP 프록시 한계

  • @transactional을 추가해도 같은 클래스 내부 호출에서는 프록시가 작동하지 않음
  • 호출 흐름:
    sendMulticastMessage() → handleBatchResponse() → handleMessagingException()
    ↑ 내부 호출이라 프록시 우회됨
-  FcmService.java

@Slf4j
@Service
@RequiredArgsConstructor
public class FcmService {
  private final FcmTokenRepository fcmTokenRepository;
  private final NotificationSettingRepository notificationSettingRepository;

  // Self-injection for proxy calls
  @Lazy
  @Autowired
  private FcmService self;

  // ...

테스트 결과 or 스크린샷 (선택)

작업한 부분을 캡처해 보여주면 이해하기 쉬워요

💬 리뷰 요구사항 (선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

@leepg038292 leepg038292 self-assigned this Nov 23, 2025
@leepg038292 leepg038292 merged commit fc163c9 into dev Nov 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant