From b454a577e4c87d14ee64a8d56504985461abc535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Moyne?= Date: Fri, 31 Mar 2023 16:10:23 -0700 Subject: [PATCH] Removes the check on the republish filter needing to have an overlap with the listened subjects, as with the new stream subject transformation changes we do not assume anymore that the subjects in a stream must match the subjects being listened to. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the use of republish for mirroring and/or sourcing streams Signed-off-by: Jean-Noël Moyne --- server/stream.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/server/stream.go b/server/stream.go index 94d92767..be5b9696 100644 --- a/server/stream.go +++ b/server/stream.go @@ -1291,20 +1291,10 @@ func (s *Server) checkStreamCfg(config *StreamConfig, acc *Account) (StreamConfi if cfg.RePublish != nil { // Check to make sure source is a valid subset of the subjects we have. // Also make sure it does not form a cycle. - var srcValid bool // Empty same as all. if cfg.RePublish.Source == _EMPTY_ { cfg.RePublish.Source = fwcs } - for _, subj := range cfg.Subjects { - if SubjectsCollide(cfg.RePublish.Source, subj) { - srcValid = true - break - } - } - if !srcValid { - return StreamConfig{}, NewJSStreamInvalidConfigError(fmt.Errorf("stream configuration for republish source is not valid subset of subjects")) - } var formsCycle bool for _, subj := range cfg.Subjects { if SubjectsCollide(cfg.RePublish.Destination, subj) {