Skip to content

Commit 227cbcd

Browse files
authored
Merge pull request #276 from spring-team-7/feature/waitlist-notification
[refactor] Amazon MQ로 인한 application.local.yml 과 STOMP 메시징 연결 설정 변경
2 parents 481778b + 9b715aa commit 227cbcd

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/main/java/org/example/tablenow/global/config/WebSocketConfig.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
2727
private final JwtHandshakeInterceptor jwtHandshakeInterceptor;
2828
private final RabbitMQProperties rabbitMQProperties;
2929

30+
@Value("${spring.rabbitmq.host}")
31+
private String rabbitMqHost;
32+
33+
@Value("${spring.rabbitmq.port}")
34+
private int rabbitMqPort;
35+
36+
3037
@Value("${chat.broker}")
3138
private String brokerType;
3239

@@ -49,8 +56,8 @@ public void configureMessageBroker(MessageBrokerRegistry registry) {
4956
} else if ("rabbit".equalsIgnoreCase(brokerType)) {
5057
// [RabbitMQ Relay] MQ로 relay
5158
registry.enableStompBrokerRelay(WebSocketConstants.TOPIC_PREFIX_RELAY)
52-
.setRelayHost("localhost") // RabbitMQ 서버 주소
53-
.setRelayPort(61613) // RabbitMQ STOMP 포트 (TCP)
59+
.setRelayHost(rabbitMqHost) // RabbitMQ 서버 주소
60+
.setRelayPort(rabbitMqPort) // RabbitMQ STOMP 포트 (TCP)
5461
.setSystemLogin(rabbitMQProperties.getUsername())
5562
.setSystemPasscode(rabbitMQProperties.getPassword())
5663
.setClientLogin(rabbitMQProperties.getUsername())

src/main/resources/application-local.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,19 @@ spring:
5353
type: redis
5454

5555
rabbitmq:
56-
host: localhost
57-
port: 5672
56+
host: ${RABBITMQ_HOST}
57+
port: ${RABBITMQ_PORT}
5858
username: ${RABBITMQ_USER}
5959
password: ${RABBITMQ_PASSWORD}
60+
ssl:
61+
enabled: ${RABBITMQ_SSL}
6062

6163
redisson:
6264
config:
6365
singleServerConfig:
6466
address: "redis://localhost:6379"
6567

6668
chat:
67-
broker: rabbit # or simple
69+
broker: rabbit # or simple
70+
71+

0 commit comments

Comments
 (0)