Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ refactor: 이벤트 발행 보장 #44

Open
DDonghyeo opened this issue Jan 3, 2025 · 0 comments
Open

♻️ refactor: 이벤트 발행 보장 #44

DDonghyeo opened this issue Jan 3, 2025 · 0 comments
Assignees
Labels

Comments

@DDonghyeo
Copy link
Member

Title

  • 발행 보장 리팩토링

Content

날씨 데이터 수집 후 이벤트 발행이 보장되지 않음

public void createWeatherAdvisory(double latitude, double longitude) throws URISyntaxException, IOException {
		
	// ... 기존 날씨 데이터 가져오는 로직

	//이벤트 전송
	applicationEventPublisher.publishEvent(new WeatherEvent.WeatherWarning(location, msg));

	WeatherAdvisory save = weatherAdvisoryRepository.save(weatherAdvisory);

}

날씨 저장 + 이벤트 전송이 ACID가 지켜지지 않음,

날씨 DB 트랜잭션이 완료되더라도 이벤트 발행이 보장되지 않음.

@DDonghyeo DDonghyeo self-assigned this Jan 3, 2025
DDonghyeo added a commit that referenced this issue Jan 21, 2025
♻️ refactor: 이벤트 발행 방식 변경 (#44)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant