Merge pull request #1754 from nats-io/mqtt

[ADDED] MQTT Support
This commit is contained in:
Ivan Kozlovic
2020-12-07 09:06:12 -07:00
committed by GitHub
22 changed files with 7749 additions and 101 deletions

View File

@@ -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))