mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 12:06: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
9
gateway/vendor/github.com/openfaas/nats-queue-worker/handler/handler.go
generated
vendored
9
gateway/vendor/github.com/openfaas/nats-queue-worker/handler/handler.go
generated
vendored
@ -7,18 +7,23 @@ import (
|
||||
)
|
||||
|
||||
// CreateNATSQueue ready for asynchronous processing
|
||||
func CreateNATSQueue(address string, port int, clusterName string, clientConfig NATSConfig) (*NATSQueue, error) {
|
||||
func CreateNATSQueue(address string, port int, clusterName, channel string, clientConfig NATSConfig) (*NATSQueue, error) {
|
||||
var err error
|
||||
natsURL := fmt.Sprintf("nats://%s:%d", address, port)
|
||||
log.Printf("Opening connection to %s\n", natsURL)
|
||||
|
||||
clientID := clientConfig.GetClientID()
|
||||
|
||||
// If 'channel' is empty, use the previous default.
|
||||
if channel == "" {
|
||||
channel = "faas-request"
|
||||
}
|
||||
|
||||
queue1 := NATSQueue{
|
||||
ClientID: clientID,
|
||||
ClusterID: clusterName,
|
||||
NATSURL: natsURL,
|
||||
Topic: "faas-request",
|
||||
Topic: channel,
|
||||
maxReconnect: clientConfig.GetMaxReconnect(),
|
||||
reconnectDelay: clientConfig.GetReconnectDelay(),
|
||||
ncMutex: &sync.RWMutex{},
|
||||
|
Reference in New Issue
Block a user