add more config to stream
This commit is contained in:
parent
a78a78fffa
commit
27a0bb627d
|
@ -23,8 +23,13 @@ func AddStream(name string, subjects []string) error {
|
||||||
if stream == nil {
|
if stream == nil {
|
||||||
subjectNames := generateSubjectNames(name, subjects)
|
subjectNames := generateSubjectNames(name, subjects)
|
||||||
_, err := natsJS.AddStream(&nats.StreamConfig{
|
_, err := natsJS.AddStream(&nats.StreamConfig{
|
||||||
Name: name,
|
Name: name,
|
||||||
Subjects: subjectNames,
|
Subjects: subjectNames,
|
||||||
|
Retention: nats.WorkQueuePolicy,
|
||||||
|
MaxConsumers: -1,
|
||||||
|
MaxMsgSize: -1,
|
||||||
|
MaxMsgs: -1,
|
||||||
|
NoAck: false,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
msg := fmt.Sprintf("add stream error: %s", err.Error())
|
msg := fmt.Sprintf("add stream error: %s", err.Error())
|
||||||
|
|
Loading…
Reference in New Issue