Skip to content

Conversation

@JamieShin0201
Copy link
Contributor

전체 라이더를 조회하고 가게와의 거리를 계산해 매칭된 라이더에게 이벤트를 발행하도록 구현

@JamieShin0201 JamieShin0201 self-assigned this Dec 27, 2022
Copy link
Collaborator

@f-lab-bright f-lab-bright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments

Comment on lines +35 to +42
.map(r ->
RiderMatchedEvent.builder()
.riderId(r.getId())
.deliveryId(delivery.getId())
.orderId(delivery.getOrderId())
.build()
)
.forEach(e -> eventPublisher.publishEvent(e));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 이벤트의 목록을 재사용하는게 아니라면 forEach 하나로 묶어도 되긴 하겠네요

"주어진 식별자에 해당하는 가게가 없습니다. 가게 ID = " + delivery.getShopId()
));

jpaRiderRepository.findAll().stream()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

라이더수가 많다면 oome가 발생할 수도 있긴 할텐데, 이 부분은 어떻게 최적화할지도 고민해보면 좋겠네요 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants