RabbitMQ Integration
GpsGate integrates with RabbitMQ. This allows you to forward devices' track data and live events to a RabbitMQ installation and consume it as you wish.
RabbitMQ is open-source message-broker software that originally implemented the Advanced Message Queuing Protocol and has since been extended with a plug-in architecture to support Streaming Text Oriented Messaging Protocol, MQ Telemetry Transport, and other protocols.
Setup
1. Log in to Site Admin (Legacy) and navigate to Plugins.
2. Click on Get More Plugins and install RabbitMQ
3. Navigate now to Integrations, select RabbitMQ, and click on Add.
This is an example of how to fill this form:
4. Fill all the fields and save the configuration.
5. Click on Test in order to test if your configuration is correct, you should see this message if everything is correct:
6. Once saved and tested, navigate to Manage Applications.
7. Enable RabbitMQ, as well as the configuration you’ve created.
8. Click on Save.
Track Messages
- Login to the Vehicle Tracker application you’ve enabled RabbitMQ in.
- Click on Main Menu > Admin > Roles. The Roles window will open.
- Click on Create copy of an already existing role and give it a new name, such as RabbitMQ.
- Select all the users for which you want to enable the Track data to be forwarded to your RabbitMQ installation.
- Enable the _RabbitMQ privilege and the configuration created in Site Admin (Legacy), in this case 'RabbitMQ Server 1'.
- Click on Save.
Event Message
- Login to the Vehicle Tracker application you’ve enabled RabbitMQ in.
- Click on Main Menu > Admin > Event Rule. The Event Rule list window will open.
- Create a new Event Rule or modify a current one. About Event Rules.
- In the Notifier section, add a new Notifier of type RabbitMQ
- Select the RabbitMQ configuration to which you want to post the Event messages
- Optionally add a Value. This can be some text and/or different signal values selected from the dropdown menu
- Select when to Nofity: Start, End, Start, and End, or Always
- Save the Event Rule
Date Type
There are 2 types of data supported:
- Tracks: Vehicle track data which includes current position and all the vehicle signals (including field script and accumulators)
- Events: Live events using an Event Rule RabbitMQ Notifier
Serializer Type
We support two serialization types: JSON and Protobuf. Protobuf is recommended since its data is much smaller which will make the data forward faster.
JSON definition for Track messages:
|
Protobuf definition for Track messages:
|
|
Json definition for Event messages:
|
|
Protobuf definition for Event messages:
|
Independently of the serialization, UTC is the track timestamp in milliseconds since Unix Epoch and Speed is in m/s.
Technical details
The RabbitMQ is set up to go through a RabbitMQ Exchange of type topic. Read more here: RabbitMQ topic exchange. This allows you to create multiple queues which will be routed using the Exchange Key.
The RabbitMQ plugin uses AMQP protocol and it acts as a RabbitMQ client.
Routing Key
The Routing Key is a template table, meaning you can use several user-specific data to compose the Routing Key. Currently, we support three templates:
- username - the username of the user
- name - the name of the user
- imei - the IMEI of the reporting device
Here are a few examples of how to use it:
- Tracks.[imei]
- User.[username]
- [imei]