Skip to content

Commit

Permalink
fix: ignore new channel without target
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumelamirand committed Apr 5, 2024
1 parent 5cb7ec9 commit 94e1c8b
Showing 1 changed file with 17 additions and 9 deletions.
Expand Up @@ -71,20 +71,28 @@ protected void doStart() throws Exception {
subscriptionListenerId =
primaryChannelEventTopic.addMessageListener(message -> {
ChannelEvent channelEvent = message.content();
log.debug(
"[{}] New PrimaryChannelEvent received for channel '{}' on target '{}'",
this.identifyConfiguration.id(),
channelEvent.channelId(),
channelEvent.targetId()
);
if (clusterManager.self().primary()) {
if (channelEvent.targetId() == null) {
log.warn(
"[{}] New PrimaryChannelEvent received for channel '{}' without any target",
this.identifyConfiguration.id(),
channelEvent.channelId()
);
} else {
log.debug(
"[{}] Handling PrimaryChannelEvent for channel '{}' on target '{}'",
"[{}] New PrimaryChannelEvent received for channel '{}' on target '{}'",
this.identifyConfiguration.id(),
channelEvent.channelId(),
channelEvent.targetId()
);
handleChannelEvent(channelEvent);
if (clusterManager.self().primary()) {
log.debug(
"[{}] Handling PrimaryChannelEvent for channel '{}' on target '{}'",
this.identifyConfiguration.id(),
channelEvent.channelId(),
channelEvent.targetId()
);
handleChannelEvent(channelEvent);
}
}
});
}
Expand Down

0 comments on commit 94e1c8b

Please sign in to comment.