-
Notifications
You must be signed in to change notification settings - Fork 59
Support customising the NATS Streaming channel and queue group. #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support customising the NATS Streaming channel and queue group. #79
Conversation
Please could you rebase? After your other PR was merged this needs an update. |
|
||
// 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a breaking change for the gateway code? https://github.com/openfaas/faas/blob/365f459b3f3a05ad17ce83f4edd86f4276af354a/gateway/server.go#L138
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just like the one introduced in #71.
|
||
clientID := clientConfig.GetClientID() | ||
|
||
// If 'channel' is empty, use the previous default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "" a valid channel? What about throwing an error for an empty value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly has backwards-compatibility in mind. If for some reason no value for channel
is provided (i.e. the faas_nats_channel
environment variable is not defined), it will fall back to the previous (well, current) default without erroring out.
Signed-off-by: Bruno Miguel Custódio <brunomcustodio@gmail.com>
@alexellis rebased! |
Thanks |
Description
This PR adds support for customising the NATS Streaming channel and queue group used for asynchronous invocations, as per openfaas/faas#1399, in a backwards-compatible way.
Motivation and Context
openfaas/faas#1399
How Has This Been Tested?
By running the included unit tests, which is enough in this case IMHO. There's also
bmcstdio/openfaas-nats-queue-worker:pr-79
, just in case.Types of changes
Checklist:
git commit -s