-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#37] 경매 상품 실시간 가격 변동 처리 #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다 ~
피드백 확인 부탁드려요!
@@ -22,7 +22,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { | |||
http.formLogin(AbstractHttpConfigurer::disable); | |||
|
|||
http.authorizeHttpRequests(authorize -> authorize | |||
.requestMatchers(new AntPathRequestMatcher("/actuator/**")).permitAll() // 관리자만 | |||
.requestMatchers(new AntPathRequestMatcher("/actuator/**")).permitAll() | |||
.requestMatchers(new AntPathRequestMatcher("/auction/kafkaEvent/subscribe")).permitAll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거 근데 kafkaEvent라는건 알려줄 필요 없는 정보같아요 ~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 알겠습니다!!
삭제하도록 하겠습니당
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
@Repository | ||
public class KafkaEmitterRepository { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거때문에 모듈이 하나 분리되어있는 것 같은데 맞나요 ?
근데 이거 워커에서만 갖고 있으면 되는거 아닌가요 이제 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 워커 모듈로 가져오도록 하겠습니다!
try { | ||
emitter.send(SseEmitter.event() | ||
.id(emitterId) | ||
.name("경매 상품 최고가 변경") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거 이벤트 발행은 다른 기능에서도 쓸 수 있으니 name도 받게 해주는게 어떨까요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵! name도 받을 수 있도록 하겠습니다
import java.io.IOException; | ||
|
||
@Service | ||
public class KafkaEmitterService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 Kafka가 붙을 필요가 없을 것 같아요 ~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 알겠습니다!
try { | ||
ObjectMapper objectMapper = new ObjectMapper(); | ||
AuctionPriceChangeNotification notification = objectMapper.readValue(message, AuctionPriceChangeNotification.class); | ||
SseEmitter adminEmitter = kafkaEmitterService.getAdminEmitter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 어차피 서비스 내에서 만들 수 있는거면 굳이 여기서 안만들어줘도 되지 않나요 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여러 방법 중 ObjectMapper를 사용해서 역직렬화한 것인데 ObjectMapper 사용안하도록 한번 해보겠습니다!
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다!
요건 더 볼건 없을거같아서 머지 하도록 할게요 ~
경매 상품 최고가 변경시 이벤트 발생 및 SSE 알림