mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Use filter_subject when calling extended consumer create API
The server consumer creation code is picky and does indeed not accept a request send to the ExT subject if that request specifies the subject filter in the array (even if there is only one entry in the array). Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com> Signed-off-by: Neil Twigg <neil@nats.io> Co-authored-by: Jean-Noël Moyne <jnmoyne@gmail.com> Co-authored-by: Neil Twigg <neil@nats.io>
This commit is contained in:
committed by
Neil Twigg
parent
ad63d702c4
commit
40ce0a9d7e
@@ -2895,7 +2895,11 @@ func (mset *stream) setSourceConsumer(iname string, seq uint64, startTime time.T
|
||||
subject = fmt.Sprintf(JSApiConsumerCreateExT, si.name, req.Config.Name, req.Config.FilterSubject)
|
||||
} else if len(req.Config.FilterSubjects) == 1 {
|
||||
req.Config.Name = fmt.Sprintf("src-%s", createConsumerName())
|
||||
subject = fmt.Sprintf(JSApiConsumerCreateExT, si.name, req.Config.Name, req.Config.FilterSubjects[0])
|
||||
// It is necessary to switch to using FilterSubject here as the extended consumer
|
||||
// create API checks for it, so as to not accidentally allow multiple filtered subjects.
|
||||
req.Config.FilterSubject = req.Config.FilterSubjects[0]
|
||||
req.Config.FilterSubjects = nil
|
||||
subject = fmt.Sprintf(JSApiConsumerCreateExT, si.name, req.Config.Name, req.Config.FilterSubject)
|
||||
} else {
|
||||
subject = fmt.Sprintf(JSApiConsumerCreateT, si.name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user