Skip to content

Commit

Permalink
[FEAT] stomp heartbeat setting and change exchange type
Browse files Browse the repository at this point in the history
  • Loading branch information
ohksj77 committed Jun 11, 2024
1 parent 75d47ec commit 73b32a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public Queue notificationQueue() {
}

@Bean
public TopicExchange notificationTopicExchange() {
return new TopicExchange(RabbitMQConstant.NOTIFICATION_EXCHANGE.getName());
public DirectExchange notificationTopicExchange() {
return new DirectExchange(RabbitMQConstant.NOTIFICATION_EXCHANGE.getName());
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@EnableWebSocketMessageBroker
public class StompConfig implements WebSocketMessageBrokerConfigurer {

private static final int HEART_BEAT_INTERVAL = 10_000;
private final RabbitMQProperties rabbitMQProperties;

@Override
Expand All @@ -31,7 +32,9 @@ public void configureMessageBroker(final MessageBrokerRegistry registry) {
.setRelayHost(rabbitMQProperties.getHost())
.setRelayPort(61613)
.setClientPasscode(rabbitMQProperties.getPassword())
.setClientLogin(rabbitMQProperties.getUsername());
.setClientLogin(rabbitMQProperties.getUsername())
.setSystemHeartbeatSendInterval(HEART_BEAT_INTERVAL)
.setSystemHeartbeatReceiveInterval(HEART_BEAT_INTERVAL);

registry.setApplicationDestinationPrefixes("/pub");
}
Expand Down

0 comments on commit 73b32a3

Please sign in to comment.