add more config to stream

This commit is contained in:
Nam Huynh 2021-10-14 09:07:22 +07:00
parent a78a78fffa
commit 27a0bb627d
1 changed files with 7 additions and 2 deletions

View File

@ -23,8 +23,13 @@ func AddStream(name string, subjects []string) error {
if stream == nil {
subjectNames := generateSubjectNames(name, subjects)
_, err := natsJS.AddStream(&nats.StreamConfig{
Name: name,
Subjects: subjectNames,
Name: name,
Subjects: subjectNames,
Retention: nats.WorkQueuePolicy,
MaxConsumers: -1,
MaxMsgSize: -1,
MaxMsgs: -1,
NoAck: false,
})
if err != nil {
msg := fmt.Sprintf("add stream error: %s", err.Error())