Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
private final JwtHandshakeInterceptor jwtHandshakeInterceptor;
private final RabbitMQProperties rabbitMQProperties;

@Value("${spring.rabbitmq.host}")
private String rabbitMqHost;

@Value("${spring.rabbitmq.port}")
private int rabbitMqPort;


@Value("${chat.broker}")
private String brokerType;

Expand All @@ -49,8 +56,8 @@ public void configureMessageBroker(MessageBrokerRegistry registry) {
} else if ("rabbit".equalsIgnoreCase(brokerType)) {
// [RabbitMQ Relay] MQ로 relay
registry.enableStompBrokerRelay(WebSocketConstants.TOPIC_PREFIX_RELAY)
.setRelayHost("localhost") // RabbitMQ 서버 주소
.setRelayPort(61613) // RabbitMQ STOMP 포트 (TCP)
.setRelayHost(rabbitMqHost) // RabbitMQ 서버 주소
.setRelayPort(rabbitMqPort) // RabbitMQ STOMP 포트 (TCP)
.setSystemLogin(rabbitMQProperties.getUsername())
.setSystemPasscode(rabbitMQProperties.getPassword())
.setClientLogin(rabbitMQProperties.getUsername())
Expand Down
10 changes: 7 additions & 3 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,19 @@ spring:
type: redis

rabbitmq:
host: localhost
port: 5672
host: ${RABBITMQ_HOST}
port: ${RABBITMQ_PORT}
username: ${RABBITMQ_USER}
password: ${RABBITMQ_PASSWORD}
ssl:
enabled: ${RABBITMQ_SSL}

redisson:
config:
singleServerConfig:
address: "redis://localhost:6379"

chat:
broker: rabbit # or simple
broker: rabbit # or simple