Skip to content

Commit

Permalink
chore: import amqp, ready for RabbitMQ message queue testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Grantzile committed Feb 1, 2025
1 parent 59ad4fd commit 531aa3d
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 3 deletions.
77 changes: 77 additions & 0 deletions .metals/metals.log
Original file line number Diff line number Diff line change
Expand Up @@ -5433,3 +5433,80 @@ Jan 31, 2025 4:42:08 AM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notif
WARNING: Unsupported notification method: metals/windowStateDidChange
Jan 31, 2025 4:42:09 AM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
WARNING: Unsupported notification method: metals/windowStateDidChange
2025.01.31 22:46:44 ERROR Unexpected error initializing server:
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request window/showMessageRequest failed with message: Canceled
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:220)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:204)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:185)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:97)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.lang.Thread.run(Thread.java:1575)

2025.01.31 22:50:45 INFO Started: Metals version 1.5.1 in folders '/home/grantzile/development/waffle/22-5-team4-server' for client Visual Studio Code 1.92.0.
2025.01.31 22:50:45 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:48 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
Jan 31, 2025 10:50:48 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 3
2025.01.31 22:50:48 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
Jan 31, 2025 10:50:48 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 2
2025.01.31 22:50:51 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
Jan 31, 2025 10:50:52 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
WARNING: Unsupported notification method: metals/windowStateDidChange
2025.01.31 22:50:56 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:56 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
Jan 31, 2025 10:50:57 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
WARNING: Unsupported notification method: metals/windowStateDidChange
2025.01.31 22:50:56 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:56 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:58 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:58 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:58 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:58 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:58 WARN no build target for: /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala
2025.01.31 22:50:58 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:58 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:58 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:59 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:50:59 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:00 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:00 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:02 WARN no build target for: /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala
2025.01.31 22:51:02 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:02 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:04 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
Jan 31, 2025 10:51:05 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
WARNING: Unsupported notification method: metals/windowStateDidChange
2025.01.31 22:51:14 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
Jan 31, 2025 10:51:14 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
WARNING: Unsupported notification method: metals/windowStateDidChange
2025.01.31 22:51:14 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:14 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:15 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:15 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:15 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:51:15 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
Jan 31, 2025 10:51:25 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
WARNING: Unsupported notification method: metals/windowStateDidChange
2025.01.31 22:51:26 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
Jan 31, 2025 10:51:27 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
WARNING: Unsupported notification method: metals/windowStateDidChange
Jan 31, 2025 10:51:44 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
WARNING: Unsupported notification method: metals/windowStateDidChange
Jan 31, 2025 10:51:55 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
WARNING: Unsupported notification method: metals/windowStateDidChange
2025.01.31 22:52:17 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:52:17 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:52:17 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:52:19 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:52:20 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:52:21 WARN no build target for: /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala
2025.01.31 22:52:21 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:52:21 INFO no build target found for /home/grantzile/development/waffle/22-5-team4-server/stress_test/src/gatling/scala/computerdatabase/ComputerDatabaseSimulation.scala. Using presentation compiler with project's scala-library version: 3.3.4
2025.01.31 22:52:23 INFO Shutting down server
2025.01.31 22:52:23 INFO shutting down Metals
2025.01.31 22:52:23 INFO Exiting server
Binary file modified .metals/metals.mv.db
Binary file not shown.
25 changes: 25 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
services:
nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- rabbitmq
- backend
networks:
- my-network

rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
ports:
- "5672:5672" # RabbitMQ 메시지 큐 포트
- "15672:15672" # RabbitMQ 관리 UI 포트 (http://localhost:15672/)
environment:
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: admin
networks:
- my-network

mysql:
image: mysql:8.4
container_name: mysql-db
Expand Down
18 changes: 18 additions & 0 deletions nginx.conf
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;
}
}
}
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))
// }
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SeatController(
return ResponseEntity.ok(GetAvailableSeatsResponse(seats))
}

// 사실상 실행 안됨
@PostMapping("/api/v1/reservation/reserve")
fun reserveSeat(
@RequestBody request: ReserveSeatRequest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.amqp.Predef._
import java.util.UUID

class DynamicReservationSimulation extends Simulation {
Expand All @@ -11,9 +12,6 @@ class DynamicReservationSimulation extends Simulation {
.contentTypeHeader("application/json")
.acceptLanguageHeader("en-US,en;q=0.5")

// 🔹 공유할 값 저장 (Scala 변수)
val sharedUsername = UUID.randomUUID().toString.take(8) // 회원가입은 한 번만 수행

val setup = exec { session =>
val newSession = session.set("username", UUID.randomUUID().toString.take(8))
newSession
Expand Down

0 comments on commit 531aa3d

Please sign in to comment.