Skip to main content

Advanced Messaging & Queuing Protocol (AMQP)

The amqp node-type exchanges messages over the AMQP protocol with a broker such as RabbitMQ.

A typical publish/subscribe pattern is used: The node automatically declares a direct exchange and dedicated queues for each subscriber.

Prerequisites​

This node-type requires rabbitmq-c (>= 0.8.0).

Implementation​

The source code of the node-type is available here: https://github.com/VILLASframework/node/blob/master/lib/nodes/amqp.cpp

Configuration​

Format Object (object) or Format Name (string) (format_spec)
uri
exchange
string

The name of the AMQP exchange the node will publish the messages to.

routing_key
string

The routing key of published messages as well as the routing key which is used to bind the subcriber queue.

object

Note: These settings are only used if the uri setting is using the amqps:// schema.

object (Input configuration (received by VILLASnode))
vectorize
integer
Default: 1

This setting allows to send multiple samples in a single message to the destination nodes.

The value of this setting determines how many samples will be combined into one packet.

Array of Hook Object (object) or Hook Name (string) (hook_list)
builtin
boolean (Builtin hook functions)
Default: true

By default, each node and paths has a couple of default hooks attached to them. With this setting the attachment of built-in hooks can be disabled.

object (Output configuration (sent out by VILLASnode))
{
  • "format": "villas.human",
  • "exchange": "string",
  • "routing_key": "string",
  • "ssl": {
    },
  • "in": {
    },
  • "vectorize": 1,
  • "hooks": [
    ],
  • "builtin": true,
  • "out": {
    }
}

Example​

node/etc/examples/nodes/amqp.conf
nodes = {
amqp_node = {
type = "amqp"
format = "json"

# Use 'amqps://' to enable SSL/TLS
uri = "amqp://username:password@example.com:1234/vhost"

# Alternatively connection settings can be specified individually
username = "guest"
password = "guest"
host = "localhost"
vhost = "/"
port = 5672

exchange = "mytestexchange"
routing_key = "abc"

ssl = {
verify_hostname = true
verify_peer = true

ca_cert = "/path/to/ca.crt"
client_cert = "/path/to/client.crt"
client_key = "/path/to/client.key"
}
}
}