Overview
Points within RabbitMQ AMQP DataSource generate data based on the received messages from RabbitMQ queue
Attributes common to all AMQP data point are:
- Name: the name of the point for use as an identifier in lists of points.
- Data type: the data type of the point. See below for details.
- Exchange Type: one of the types in which ScadaLTS receive messages from the broker
Exchanges
Exchange is an AMQP entitle which define how to route the message into zero or more queues. This
procedure divers within various exchange types. Each exchange has separate attributes like: Name, Durability or Auto-delete.
Durable exchange survive broker restart, but Transient do not - they have to be redeclared when broker comes back online.
Below are described different exchange types with example usage and configuration.
Default Exchange ("Empty")
About:
This is a kind of direct exchange with empty name of it. It used the default exchange declared
by the broker. It is very simple to define that exchange - very useful for non-complex implementations.
Is has queues which are bound to it with the routing key that match queue name
Usage example:
Receive temperature data from your Raspberry PI
Configuration:
Assume that your PI sends every five seconds simple numeric data from a temperature sensor to your RabbitMQ broker
to default exchange (name = "") to queue called "Living_room_temperature".
Assume also that you have pre-configured DataSource with filled IP Address, port and Virtual Host fields
- Create a new Data Point with name "Temperature LivingRoom sensor"
- Select data type as "Numeric" - because PI sends simple numeric values
- Select exchange type as "Empty" - use simplest option to create data point
- Enter a rabbitMQ Queue Name "Living_room_temperature" (the same on which Raspberry sends a messages)
- Select Queue Durability to "Durable" and Ack Mode to "No ACK" (make sure that your queue in broker is also durable)
- Save Data Point and enable it and enable Data Source
- Open watch list to see incoming values from your device
Direct Exchange
About:
This type of exchanges delivers messages to queues according to the message routing key.
Usage example:
Receive messages from different news feeds
Configuration:
Assume that RabbitMQ broker receive from different sources (like "sport", "events", "music") messages data with latest news from
the world to exchange called "news". We can also receive the same messages kind on the other exchange called "local_news".
- Create first Data Point with name "WorldNews - sport"
- Select data type as "Alphanumeric"
- Select exchange type as "Direct"
- Enter a RabbitMQ Exchange Name "news"
- Enter a routing key "sport" - which kind of messages we want to receive.
- Select Queue Durability to "Durable" and Ack Mode to "No ACK" (make sure that your queue in broker is also durable)
- Save Data Point
- Create second Data Point with name "WorldNews - events" and repeat steps (2, 3 and 4)
- Enter a routing key "events"
- Save Data Point and enable all than enable Data Source
- Open watch list to see incoming values from your device
Topic Exchange
About:
This type is similar to direct one but has one improvement - pattern matching. This exchange can
route the messages based on matching routing key and the pattern that was used to bind a queue
to an exchange. It has a board set of use cases form distributing relevant data to specific
geographic location, stock price updates, logging routing and much more.
- * (star) can substitute for exactly one word.
- # (hash) can substitute for zero or more words.
Usage example:
Receive specific logs from production environment
Configuration:
Assume that RabbitMQ broker receive data from different applications in different levels of log
to exchange called "apps_logs".
- Create first Data Point with name "ScadaLTS info"
- Select data type as "Alphanumeric"
- Select exchange type as "Topic"
- Enter a RabbitMQ Exchange Name "apps_logs"
- Enter a routing key "scada.info" - which kind of messages we want to receive.
- Select Queue Durability to "Durable" and Ack Mode to "No ACK" (make sure that your queue in broker is also durable)
- Save Data Point
- Create second Data Point with name "ScadaDashboard - all" and repeat steps (2, 3 and 4)
- Enter a routing key "scada_dashboard.*"
- Save Data Point
- Create third Data Point with name "all logs" and repeat steps (2, 3 and 4)
- Enter a routing key "#"
- Save Data Point and enable all than enable Data Source
- Open watch list to see incoming values from your device
Fanout Exchange
About:
This exchange type is similar to IP broadcast behaviour. Based on the exchange name we receive all data
from this exchange. This exchange routes messages to all of the queues that are bound to it and the
routing key is ignored.