Configuration - peter-mount/opendatabridge GitHub Wiki
The bridge is configured using a single xml file.
The file starts with a single rabbitmq element declaring the destination message broker:
<?xml version="1.0" encoding="UTF-8"?>
<!-- test configuration -->
<config xmlns="http://area51.dev/xsd/amqrabbitbridge/v1">
<rabbitmq hostname="rabbit.example.com">
<credentials>
<username>guest</username>
<password>guest</password>
</credentials>
</rabbitmq>
</config>
After the rabbitmq definition we then need to define one or more activemq elements which will be used as the source message broker(s).
Each one of these will also contain one or more topic or queue definitions which will be the remote sources on that broker. Within each topic or queue we then declare one or more consumers. When a message is received from the source, each consumer will receive that message.
<activemq hostname="datafeeds.networkrail.co.uk" port="61619">
<credentials>
<username>remote user</username>
<password>remote password</password>
</credentials>
<topic topic="TD_ALL_SIG_AREA">
<log label="record nr.td"/>
<graphite metric="feeds.nr.td" metricNameInBody="true"/>
<bridge routingKey="nr.td.all"/>
</topic>
</activemq>
The primary documentation for this file is in the config.xsd schema but this page makes that easier to read.
The following show the available attributes for the main elements within the configuration. The consumers for topic's and queue's are defined separately on the Consumers page.
Defines a source ActiveMQ instance
Attribute | Required | Default | Description |
---|---|---|---|
hostname | yes | The remote hostname | |
port | optional | 61616 | The port ActiveMQ is listening on |
clientId | optional | the username | clientId for durable subscribers |
disabled | optional | false | If true then this broker definition will be ignored |
- credentials element holding the username/password
- one or more topic or queue elements defining the source topic or queue to receive messages
The credentials that a message broker (activemq or rabbitmq) needs to authenticate. It consists of two child elements:
- username - the remote username
- password - the remote password
Defines the destination RabbitMQ instance
Attribute | Required | Default | Description |
---|---|---|---|
hostname | yes | The remote hostname | |
port | optional | 5672 | The port RabbitMQ is listening on |
vhost | optional | / | The vhost |
- credentials element holding the username/password
Defines a remote queue in ActiveMQ that we want to subscribe to
Attribute | Required | Default | Description |
---|---|---|---|
queue | yes | The remote queue name |
Defines a remote topic in ActiveMQ that we want to subscribe to
Attribute | Required | Default | Description |
---|---|---|---|
topic | yes | The remote topic name |