mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 03:56:37 +00:00
Support customising the NATS Streaming channel.
Signed-off-by: Bruno Miguel Custódio <brunomcustodio@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
3422bdcce9
commit
03dc8824d2
@ -106,6 +106,14 @@ func (ReadConfig) Read(hasEnv HasEnv) (*GatewayConfig, error) {
|
||||
cfg.NATSClusterName = &v
|
||||
}
|
||||
|
||||
faasNATSChannel := hasEnv.Getenv("faas_nats_channel")
|
||||
if len(faasNATSChannel) > 0 {
|
||||
cfg.NATSChannel = &faasNATSChannel
|
||||
} else {
|
||||
v := "faas-request"
|
||||
cfg.NATSChannel = &v
|
||||
}
|
||||
|
||||
prometheusPort := hasEnv.Getenv("faas_prometheus_port")
|
||||
if len(prometheusPort) > 0 {
|
||||
prometheusPortVal, err := strconv.Atoi(prometheusPort)
|
||||
@ -197,6 +205,9 @@ type GatewayConfig struct {
|
||||
// The name of the NATS Streaming cluster. Required for async mode.
|
||||
NATSClusterName *string
|
||||
|
||||
// NATSChannel is the name of the NATS Streaming channel used for asynchronous function invocations.
|
||||
NATSChannel *string
|
||||
|
||||
// Host to connect to Prometheus.
|
||||
PrometheusHost string
|
||||
|
||||
|
Reference in New Issue
Block a user