rabbitmq-connector

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 13 Imported by: 0

README

OpenFaaS RabbitMQ Connector

Go Report Card CodeFactor CI Docker Release codecov

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.

Usage

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.

Please also make sure to check out the official Rabbit MQ documentation here and here in order to avoid message dropping.

Configuration

General Connector:

  • basic_auth: Toggle to activate or deactivate basic_auth (E.g 1 || true)
  • secret_mount_path: The path to a file containing the basic auth secret for the OpenFaaS gateway
  • OPEN_FAAS_GW_URL: URL to the OpenFaaS gateway defaults to http://gateway:8080
  • REQ_TIMEOUT: Request Timeout for invocations of OpenFaaS functions defaults to 30s
  • TOPIC_MAP_REFRESH_TIME: Refresh time for the topic map defaults to 60s
  • INSECURE_SKIP_VERIFY: Allows to skip verification of HTTP Cert for Communication Connector <=> OpenFaaS default is false. It is recommended to keep false, as enabling it opens up the possibility of a man in the middle attack.

RabbitMQ Related:

  • RMQ_HOST: Hostname/ip of Rabbit MQ
  • RMQ_PORT: Port of Rabbit MQ
  • RMQ_USER: Defaults to guest
  • RMQ_PASS: Defaults to pass
  • PATH_TO_TOPOLOGY: Path to the yaml describing the topology, has no default and is required
Topology Configuration

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}.

Bug Reporting & Feature Requests

Please feel free to report any issues or Feature request on the Issue Tab.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL