mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-15 18:50:41 -07:00
@@ -51,6 +51,12 @@ type StreamConfig struct {
|
||||
NoAck bool `json:"no_ack,omitempty"`
|
||||
Template string `json:"template_owner,omitempty"`
|
||||
Duplicates time.Duration `json:"duplicate_window,omitempty"`
|
||||
|
||||
// These are non public configuration options.
|
||||
// If you add new options, check fileStreamInfoJSON in order for them to
|
||||
// be properly persisted/recovered, if needed.
|
||||
internal bool
|
||||
allowNoSubject bool
|
||||
}
|
||||
|
||||
const JSApiPubAckResponseType = "io.nats.jetstream.api.v1.pub_ack_response"
|
||||
@@ -467,7 +473,9 @@ func checkStreamCfg(config *StreamConfig) (StreamConfig, error) {
|
||||
}
|
||||
|
||||
if len(cfg.Subjects) == 0 {
|
||||
cfg.Subjects = append(cfg.Subjects, cfg.Name)
|
||||
if !cfg.allowNoSubject {
|
||||
cfg.Subjects = append(cfg.Subjects, cfg.Name)
|
||||
}
|
||||
} else {
|
||||
// We can allow overlaps, but don't allow direct duplicates.
|
||||
dset := make(map[string]struct{}, len(cfg.Subjects))
|
||||
|
||||
Reference in New Issue
Block a user