mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 00:06:38 +00:00
Re-vendor queue-worker publisher for reconnect
- re-vendor queue-worker for publisher via 0.6.0 - bump queue-worker version to 0.6.0 in docker-compose.yml for AMD64 - use new naming for NATS of nats -> NATS in variables where required - add default reconnect of 60 times, 2 seconds apart. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
e63150ef70
commit
b4a550327d
@ -10,12 +10,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/openfaas/faas/gateway/handlers"
|
||||
"github.com/openfaas/faas/gateway/scaling"
|
||||
|
||||
"github.com/openfaas/faas-provider/auth"
|
||||
"github.com/openfaas/faas/gateway/handlers"
|
||||
"github.com/openfaas/faas/gateway/metrics"
|
||||
"github.com/openfaas/faas/gateway/plugin"
|
||||
"github.com/openfaas/faas/gateway/scaling"
|
||||
"github.com/openfaas/faas/gateway/types"
|
||||
natsHandler "github.com/openfaas/nats-queue-worker/handler"
|
||||
)
|
||||
@ -103,7 +102,12 @@ func main() {
|
||||
|
||||
if config.UseNATS() {
|
||||
log.Println("Async enabled: Using NATS Streaming.")
|
||||
natsQueue, queueErr := natsHandler.CreateNatsQueue(*config.NATSAddress, *config.NATSPort, natsHandler.DefaultNatsConfig{})
|
||||
maxReconnect := 60
|
||||
interval := time.Second * 2
|
||||
|
||||
defaultNATSConfig := natsHandler.NewDefaultNATSConfig(maxReconnect, interval)
|
||||
|
||||
natsQueue, queueErr := natsHandler.CreateNATSQueue(*config.NATSAddress, *config.NATSPort, defaultNATSConfig)
|
||||
if queueErr != nil {
|
||||
log.Fatalln(queueErr)
|
||||
}
|
||||
|
Reference in New Issue
Block a user