This project is an unofficial trigger for OpenFaaS functions based on RabbitMQ Messages. Where it leverages the
Routing keys
to call OpenFaaS functions which listen to that topic
. For usage information please go to here.
Using the OpenFaaS CLI or Rest API
deploy a function which has an annotation
named topic
, this has to be a comma-separated string of the relevant topics.
E.g. log,monitoring,billing
.
In case an error occurred during the invocation of the function(s) the message is attempted to be transferred back to the Queue. Therefore you should ensure your functions can handle being called potentially twice with the same payload.
Further the returned output from the function is ignored, as the connector currently only supports fire & forget flows.
Please also make sure to check out the official Rabbit MQ documentation here and here in order to avoid message dropping.
General Connector:
basic_auth
: Toggle to activate or deactivate basic_auth (E.g1
||true
)secret_mount_path
: The path to a file containing the basic auth secret for the OpenFaaS gatewayOPEN_FAAS_GW_URL
: URL to the OpenFaaS gateway defaults tohttp://gateway:8080
REQ_TIMEOUT
: Request Timeout for invocations of OpenFaaS functions defaults to30s
TOPIC_MAP_REFRESH_TIME
: Refresh time for the topic map defaults to60s
INSECURE_SKIP_VERIFY
: Allows to skip verification of HTTP Cert for Communication Connector <=> OpenFaaS default isfalse
. It is recommended to keep false, as enabling it opens up the possibility of a man in the middle attack.MAX_CLIENT_PER_HOST
: Allows to specify the maximum number connections/clients that will be opened to an individual host (function), defaults to256
.
TLS Config:
TLS_ENABLED
: Set this totrue
if your RabbitMQ requires a TLS connection. Default tofalse
if not set.TLS_CA_CERT_PATH
: Path to your CA Cert, make sure golang process is allowed to access it.TLS_SERVER_CERT_PATH
: Path to Client Cert, make sure golang process is allowed to access it.TLS_SERVER_KEY_PATH
: Path to Client Key, make sure golang process is allowed to access it.
Make sure if TLS is enabled, the provided
RMQ_HOST
matches the common name from the certificate. Otherwise the connection will yield a error
RabbitMQ Related:
RMQ_HOST
: Hostname/ip of Rabbit MQRMQ_PORT
: Port of Rabbit MQRMQ_VHOST
: Used to specify the vhost for Rabbit MQ, will default to/
RMQ_USER
: Defaults to "", if user and pass are both "" than no credentials will be used for connectingRMQ_PASS
: Defaults to "", if user and pass are both "" than no credentials will be used for connectingPATH_TO_TOPOLOGY
: Path to the yaml describing the topology, has no default and is required
Compared to v0 this is the biggest change, you can bring your existing Exchange definition to the connector. The topology is defined in the following format (Example):
# Name of the exchange
- name: Exchange_Name # Required
topics: [Foo, Bar] # Required
# Do we need to declare the exchange ? If it already exists it verifies that the exchange matches the configuration
declare: true # Default: false
# Either direct or topic
type: "direct" # Required
# Persistence of Exchange between Rabbit MQ Server restarts
durable: false # Default: false
# Auto Deletes Exchange once all consumer are gone
auto-deleted: false # Default: false
Queues will be configured accordingly to there exchange declaration in regards to durable
& auto-deleted
. Further the name of the queue
will be generated based on the following schema: OpenFaaS_{Exchange_Name}_${Topic}
.
Please feel free to report any issues or Feature request on the Issue Tab.