HacklabMQ

From Hacklab.TO Public Wiki
Jump to: navigation, search

The lab has an AMQP-based message queuing infrastructure shared between various services. The broker RabbitMQ is located on moa (192.168.111.14), which is on the lab's LDAP system.

Exchanges[edit]

  • door.entry - Fanout exchange, one message gets pushed to the exchange
    • Format: JSON message each time a card is swiped at any door associated with the HackLab.
  • notification.graphic - Fanout exchange, messages pushed to this exchange indicate animated graphics which should be sent to lab occupants somehow (e.g. LED sign)
    • Format: Name of the animation to display. Currently "ostrich" is the only supported animation.
  • notification.general - Fanout exchange, messages pushed to this exchange indicate graphics which should be sent to lab occupants somehow (e.g. LED sign, twitter, doorbot)
    • Format: JSON, 'text' and 'image' keys, images referenced should be in NFS user home directories, 'public' key says whether to hide or show this message in public spaces
  • statistics.bandwidth - Fanout exchange, messages pushed to this exchange indicate bandwidth statistics that can be stored/reported by other systems
    • Format: TBD
  • statistics.power - Fanout exchange, messages pushed to this exchange indicate power statistics that can be stored/reported by other systems
    • Format: JSON, 'meter_id' key for what circuit or area is being metered (using standard lab electrical system identifiers), 'watts' for how many watts are in use at the time of reporting, 'cost' for cost per hour at the present time based on the wattage in use
  • statistics.occupancy - Fanout exchange, messages pushed to this exchange indicate which areas of the lab are occupied at the present time.
    • Format: JSON, 'area' for which area the report is for, 'occupied' for whether this area is presently occupied, 'last_detected' for the number of minutes ago movement was last detected in the area, 'change' for whether this is a change in the occupied status from the last report.
  • eight - Fanout exchange, messages sent to this exchange indicate the number 8 should be printed full-screen (white text on a black background) and/or announced verbally. See also: 8.
    • Format: {eight: 8}

Queues[edit]

Queues are named <exchange>.<service>, e.g. doorbot's door.entry queue would be is door.entry.doorbot.

Message Flow Diagram[edit]

This is a graph with borders and nodes that may contain hyperlinks.
About this image