RabbitMQ

AMQP messaging solution ideal for IoT and client / server use cases

Overview

RabbitMQ is a lightweight and easy-to-deploy messaging platform that supports multiple messaging protocols. It can be configured in distributed and federated setups to meet high-scale and high-availability requirements.

Joule enables publishing to RabbitMQ queues, exchanges and topics, providing flexible event-driven architectures.

Additionally, the page highlights the usage of Joule to consume events via RabbitMQ messaging subscriptions.

Examples & DSL attributes

This example shows how to configure a RabbitMQ consumer that subscribes to specific event types using routing keys with a topic exchange.

The consumer listens for events related to quotes for specific stocks (IBM, MSFT and GOOG) from the marketQuotes exchange.

The events are deserialised from a StreamEvent JSON object into a Joule StreamEvent object using a custom parser.

rabbitConsumer:
  host: localhost
  exchange:
    name: marketQuotes
    type: TOPIC
  
  routing:
    keys:
      - NASDAQ.IBM
      - NASDAQ.MSFT
      - NASDAQ.GOOG
  
  deserializer:
    parser: 
      com.fractalworks.examples.banking.data.QuoteToStreamEventParser

Attributes schema

Exchange attributes schema

Exchange example

rabbitConsumer:
    ...
    exchange:
        name: marketQuotes
        type: DIRECT

Routing attributes schema

Routing example

This example will subscribe to all events that match the first component of the key 'NASDAQ'

rabbitConsumer:
    ...
    routing:
        keys:
          - NASDAQ.#

Additional resources

Further AMQP resources can be found on the following links:

Last updated