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

@ -25,6 +25,11 @@ func AddStream(name string, subjects []string) error {
_, err := natsJS.AddStream(&nats.StreamConfig{
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())