VILLASframework
Modular co-simulation framework
Advanced Messaging & Queuing Protocol (AMQP)

The Advanced Messaging & Queuing Protocol (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://git.rwth-aachen.de/acs/public/villas/node/blob/master/lib/nodes/amqp.cpp

Configuration

format (string)

The payload format which is used to encode and decode exchanged messages.

uri (string)

See also: https://www.rabbitmq.com/uri-spec.html

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.

ssl (object)

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

Example

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