mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
tested flushing nats.Conn
This commit is contained in:
parent
8ec6372565
commit
93a61d8ef3
2 changed files with 10 additions and 1 deletions
10
process.go
10
process.go
|
@ -272,8 +272,16 @@ func (p process) messageDeliverNats(natsMsgPayload []byte, natsMsgHeader nats.He
|
||||||
}
|
}
|
||||||
p.metrics.promNatsDeliveredTotal.Inc()
|
p.metrics.promNatsDeliveredTotal.Inc()
|
||||||
|
|
||||||
// The reaming logic is for handling ACK messages, so we return here
|
//err = natsConn.Flush()
|
||||||
|
//if err != nil {
|
||||||
|
// er := fmt.Errorf("error: nats publish flush failed: %v", err)
|
||||||
|
// log.Printf("%v\n", er)
|
||||||
|
// return
|
||||||
|
//}
|
||||||
|
|
||||||
|
// The remaining logic is for handling ACK messages, so we return here
|
||||||
// since it was a NACK message, and all or now done.
|
// since it was a NACK message, and all or now done.
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,7 @@ func NewServer(configuration *Configuration, version string) (*server, error) {
|
||||||
// Setting MaxReconnects to -1 which equals unlimited.
|
// Setting MaxReconnects to -1 which equals unlimited.
|
||||||
conn, err = nats.Connect(configuration.BrokerAddress,
|
conn, err = nats.Connect(configuration.BrokerAddress,
|
||||||
opt,
|
opt,
|
||||||
|
//nats.FlusherTimeout(time.Second*10),
|
||||||
nats.MaxReconnects(-1),
|
nats.MaxReconnects(-1),
|
||||||
nats.ReconnectJitter(time.Duration(configuration.NatsReconnectJitter)*time.Millisecond, time.Duration(configuration.NatsReconnectJitterTLS)*time.Second),
|
nats.ReconnectJitter(time.Duration(configuration.NatsReconnectJitter)*time.Millisecond, time.Duration(configuration.NatsReconnectJitterTLS)*time.Second),
|
||||||
nats.Timeout(time.Second*time.Duration(configuration.NatsConnOptTimeout)),
|
nats.Timeout(time.Second*time.Duration(configuration.NatsConnOptTimeout)),
|
||||||
|
|
Loading…
Reference in a new issue