-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: import amqp, ready for RabbitMQ message queue testing
- Loading branch information
Showing
7 changed files
with
142 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
events {} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
|
||
# 특정 API 요청만 RabbitMQ로 전달 | ||
location = /api/v1/reservation/reserve { | ||
proxy_pass http://rabbitmq:15672/api/exchanges/amq.default/publish; | ||
proxy_set_header Content-Type application/json; | ||
} | ||
|
||
# 나머지 API 요청은 백엔드 서버(Spring Boot)로 전달 | ||
location /api/ { | ||
proxy_pass http://backend:8080; | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/com/wafflestudio/interpark/seat/controller/RabbitMqListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import org.springframework.amqp.rabbit.annotation.RabbitListener | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class RabbitMqListener { | ||
@RabbitListener(queues = ["reservation-queue"]) | ||
fun listen(message: String) { | ||
|
||
} | ||
} | ||
|
||
|
||
|
||
// fun reserveSeat( | ||
// @RequestBody request: ReserveSeatRequest, | ||
// @AuthenticationPrincipal userDetails: UserDetailsImpl | ||
// ): ResponseEntity<ReserveSeatResponse> { | ||
// val reservationId = seatService.reserveSeat(userDetails.getUserId(), request.performanceEventId, request.seatId) | ||
// return ResponseEntity.status(201).body(ReserveSeatResponse(reservationId)) | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters