Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Files

Latest commit

anthonyalbertodavissp14pete-mayyoonsio
Dec 2, 2021
6b30c38 · Dec 2, 2021

History

History

rabbitmq

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 24, 2017
Dec 2, 2021
Mar 9, 2017
Nov 16, 2017
Dec 2, 2021
Aug 30, 2017
Aug 30, 2017
Apr 12, 2017
Apr 12, 2017
Mar 9, 2017
Mar 9, 2017
Jun 22, 2017

RabbitMQ adaptor

The RabbitMQ adaptor is capable of consuming and publishing JSON data.

When being used to publish data, you need to configure the routing_key and the exchange is pulled from the message namespace (i.e. database collection/table). If key_in_field is set to true, transporter will use the field defined routing_key to lookup the value from the data.

NOTE key_in_field defaults to false and will therefore use the static routing_key, if you set routing_key to an empty string, no routing key will be set in the published message.

Configuration

rmq = rabbitmq({
  "uri": "amqp://127.0.0.1:5672/",
  "routing_key": "test",
  "key_in_field": false
  // "delivery_mode": 1, // non-persistent (1) or persistent (2)
  // "api_port": 15672,
  // "ssl": false,
  // "cacerts": ["/path/to/cert.pem"]
})

Run adaptor test

Spin up required containers (rabbitmq, haproxy)

# From transporter's root folder
cd config/rabbitmq
docker build . -t rabbit_haproxy
cd test_setup
docker-compose up -d
# Wait ~30s

Run the tests

# From transporter's root folder
go test -v ./adaptor/rabbitmq/