SIRI-ET MQTT Updater
Support for consuming SIRI-ET messages over an MQTT subscription. Similarly to the SIRI-ET HTTP updater, this updater is developed to support the Nordic SIRI profile which is a subset of the SIRI specification.
Contact Info
HBT, Hamburg, Germany jessica.koehnke@hbt.de
Documentation
This updater consumes SIRI real time information over an asynchronous MQTT feed by subscribing to an MQTT topic.
For more documentation see the Norwegian SIRI profile .
Configuration
To enable the SIRI-ET MQTT updater you need to add it to the updaters section of the
router-config.json.
SIRI-ET via MQTT
| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since |
|---|---|---|---|---|---|
| type = "siri-et-mqtt" | enum |
The type of the updater. | Required | 1.5 | |
| connectionStartupTimeout | duration |
How long to wait for the MQTT broker to be available at startup. | Optional | "PT30S" |
2.10 |
| feedId | string |
The feed ID this updater should be applied to | Required | 2.9 | |
| fuzzyTripMatching | boolean |
Deprecated, use fuzzyMatching. If the fuzzy trip matcher should be used to match trips. |
Optional | false |
2.9 |
| host | string |
The host of the MQTT broker | Required | 2.9 | |
| maxPrimingIdleTime | duration |
Max idle time until priming is considered complete. | Optional | "PT1S" |
2.9 |
| numberOfPrimingWorkers | integer |
Number of priming workers to process retained messages | Optional | 1 |
2.9 |
| password | string |
The password for authorization at the MQTT broker | Optional | 2.9 | |
| port | integer |
The port of the MQTT broker | Required | 2.9 | |
| qos | integer |
The qos used for the MQTT subscription | Required | 2.9 | |
| topic | string |
The topic the updater should subscribe to | Required | 2.9 | |
| user | string |
The user for authorization at the MQTT broker | Optional | 2.9 | |
| fuzzyMatching | object |
Enable the fuzzy trip matcher, with options. | Optional | 2.11 | |
| timeTolerance | duration |
The maximum difference between the scheduled and the aimed times. | Optional | "PT0S" |
2.11 |
Parameter details
connectionStartupTimeout
Since version: 2.10 ∙ Type: duration ∙ Cardinality: Optional ∙ Default value: "PT30S"
Path: /updaters/[17]
How long to wait for the MQTT broker to be available at startup.
If the MQTT broker is unavailable when OTP starts, OTP will wait up to this duration for the broker to become available before allowing routing requests. If the broker connects within this time, normal priming occurs: retained messages are processed before routing is enabled. If the broker does not connect within this time, OTP will start routing without real-time data. The MQTT client will continue attempting to reconnect in the background, and live messages will be processed once the broker is available.
fuzzyTripMatching
Since version: 2.9 ∙ Type: boolean ∙ Cardinality: Optional ∙ Default value: false
Path: /updaters/[17]
Deprecated, use fuzzyMatching. If the fuzzy trip matcher should be used to match trips.
true is the same as "fuzzyMatching" : {}. This parameter is ignored if fuzzyMatching is
set, so both can be set in a configuration used by OTP versions with and without
fuzzyMatching.
maxPrimingIdleTime
Since version: 2.9 ∙ Type: duration ∙ Cardinality: Optional ∙ Default value: "PT1S"
Path: /updaters/[17]
Max idle time until priming is considered complete.
The worker(s) processing the retained messages for priming shut down when they are idle for the specified amount of time. When all priming workers are shut down, the updater is considered to be primed.
numberOfPrimingWorkers
Since version: 2.9 ∙ Type: integer ∙ Cardinality: Optional ∙ Default value: 1
Path: /updaters/[17]
Number of priming workers to process retained messages
The updater will only be primed and therefore ready for routing requests, when all retained messages are processed. If the number of retained messages is large, this could take a considerable amount of time. Profiling shows that the bottleneck is in the XML parsing. Increasing the number of priming workers will parallelize parsing. Tests show that 4 priming workers seem to be the optimal amount, increasing the number of priming workers further will decrease performance. The reception of the messages and the updating of the graph always occurs in a single thread.
password
Since version: 2.9 ∙ Type: string ∙ Cardinality: Optional
Path: /updaters/[17]
The password for authorization at the MQTT broker
If no authorization is required, the password does not need to be supplied.
user
Since version: 2.9 ∙ Type: string ∙ Cardinality: Optional
Path: /updaters/[17]
The user for authorization at the MQTT broker
If no authorization is required, the user does not need to be supplied.
fuzzyMatching
Since version: 2.11 ∙ Type: object ∙ Cardinality: Optional
Path: /updaters/[17]
Enable the fuzzy trip matcher, with options.
The fuzzy trip matcher identifies the scheduled trip of a SIRI-ET message by its last stop, line, service date and the aimed times of the first and last call. Use it for producers whose messages do not contain usable trip ids.
If this parameter is set, fuzzy trip matching is enabled with the given options and the
deprecated fuzzyTripMatching parameter is ignored. Use an empty object {} to enable fuzzy
trip matching with the default options.
If a trip matches the aimed times exactly, it is used. Otherwise, if more than one trip matches within the time tolerance, the message is rejected.
timeTolerance
Since version: 2.11 ∙ Type: duration ∙ Cardinality: Optional ∙ Default value: "PT0S"
Path: /updaters/[17]/fuzzyMatching
The maximum difference between the scheduled and the aimed times.
A scheduled trip matches if its scheduled departure time at the first stop and its scheduled arrival time at the last stop differ from the SIRI aimed times by at most this duration. Use this if the producer sends aimed times in whole minutes, while the schedule contains seconds. The tolerance must be in whole seconds and less than 30 minutes. A larger tolerance increases the chance that more than one trip matches, in which case the message is rejected.
Example configuration
// router-config.json
{
"updaters" : [
{
"type" : "siri-et-mqtt",
"user" : "user",
"password" : "pwd",
"host" : "localhost",
"port" : 1883,
"feedId" : "1",
"topic" : "trip/updates/#",
"qos" : 1,
"fuzzyTripMatching" : true,
"fuzzyMatching" : {
"timeTolerance" : "59s"
},
"numberOfPrimingWorkers" : 4,
"maxPrimingIdleTime" : "1s"
}
]
}