[added] check for mirror stream return error when de dupe window is set

Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
Matthias Hanel
2021-05-10 19:57:17 -04:00
parent 4ae9beddea
commit f4251feb0f

View File

@@ -1240,7 +1240,11 @@ func (s *Server) jsStreamCreateRequest(sub *subscription, c *client, subject, re
s.sendAPIErrResponse(ci, acc, subject, reply, string(msg), s.jsonResponse(&resp))
return
}
if cfg.Duplicates != time.Duration(0) {
resp.Error = &ApiError{Code: 400, Description: "stream mirrors do not make use of a de-duplication window"}
s.sendAPIErrResponse(ci, acc, subject, reply, string(msg), s.jsonResponse(&resp))
return
}
// We do not require other stream to exist anymore, but if we can see it check payloads.
exists, maxMsgSize, subs := hasStream(cfg.Mirror.Name)
if len(subs) > 0 {