openfaas / nats-queue-worker

Queue-worker for OpenFaaS with NATS Streaming
https://docs.openfaas.com/reference/async/
MIT License
128 stars 59 forks source link

Allow alternate port for gateway to invoke functions #59

Closed acornies closed 4 years ago

acornies commented 5 years ago

Expected Behaviour

When using OpenFaaS on Nomad I'd expect to be able to override the gateway port based on my configuration.

Current Behaviour

The queue worker has a hard-coded value of :8080 as the gateway port. https://github.com/openfaas/nats-queue-worker/blob/master/main.go#L80

Possible Solution

Allow the gateway port to be configurable or pass and use the information from the async request message itself.

Context

I cannot setup the queue worker in my Nomad-based OpenFaaS environment since my gateway port is not listening on :8080 and there's no default overlay networking.

alexellis commented 5 years ago

@acornies is this still the case?

acornies commented 5 years ago

Yes: https://github.com/openfaas/nats-queue-worker/blob/master/main.go#L33

alexellis commented 5 years ago

I guess on K8s/Swarm, all gateway services listen on port 8080. Is this a nomad thing?

alexellis commented 5 years ago

I'd accept a patch that included the port in the gateway address / configuration.

acornies commented 5 years ago

Will do! In short, yes. I've worked around it for now but would be nice to have it configurable for those not running overlay.

alexellis commented 5 years ago

Looks like @jonatasbaldin has picked this up now.