SIRI-ET Google PubSub Updater
Support for consuming SIRI-ET messages over a Google Cloud PubSub 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
Entur, Norway https://entur.no/
Documentation
This updater consumes SIRI real time information over an asynchronous publisher/subscriber feed provided by a Google Cloud PubSub topic.
For more documentation see the Entur Real-Time Data documentation and the Norwegian SIRI profile .
Configuration
To enable the SIRI-ET Google PubSub updater you need to add it to the updaters section of the
router-config.json.
SIRI-ET via Google PubSub
| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since |
|---|---|---|---|---|---|
| type = "siri-et-google-pubsub-updater" | enum |
The type of the updater. | Required | 1.5 | |
| dataInitializationUrl | string |
URL used to download over HTTP the recent history of SIRI-ET messages. | Optional | 2.1 | |
| feedId | string |
The ID of the feed to apply the updates to. | Optional | 2.1 | |
| fuzzyTripMatching | boolean |
Deprecated, use fuzzyMatching. If the fuzzy trip matcher should be used to match trips. |
Optional | false |
2.1 |
| initialGetDataTimeout | duration |
Timeout for retrieving the recent history of SIRI-ET messages. | Optional | "PT30S" |
2.1 |
| producerMetrics | boolean |
If failure, success, and warning metrics should be collected per producer. | Optional | false |
2.7 |
| reconnectPeriod | duration |
Wait this amount of time before trying to reconnect to the PubSub subscription. | Optional | "PT30S" |
2.1 |
| subscriptionProjectName | string |
The Google Cloud project that hosts the PubSub subscription. | Required | 2.1 | |
| topicName | string |
The name of the PubSub topic that publishes the updates. | Required | 2.1 | |
| topicProjectName | string |
The Google Cloud project that hosts the PubSub topic that publishes the updates. | Required | 2.1 | |
| 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
dataInitializationUrl
Since version: 2.1 ∙ Type: string ∙ Cardinality: Optional
Path: /updaters/[12]
URL used to download over HTTP the recent history of SIRI-ET messages.
Optionally the updater can download the recent history of SIRI-ET messages from this URL. If this parameter is set, the updater will be marked as initialized (primed) only when the message history is fully downloaded and applied.
fuzzyTripMatching
Since version: 2.1 ∙ Type: boolean ∙ Cardinality: Optional ∙ Default value: false
Path: /updaters/[12]
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.
initialGetDataTimeout
Since version: 2.1 ∙ Type: duration ∙ Cardinality: Optional ∙ Default value: "PT30S"
Path: /updaters/[12]
Timeout for retrieving the recent history of SIRI-ET messages.
When trying to fetch the message history over HTTP, the updater will wait this amount of time for the connection to be established. If the connection times out, the updater will retry indefinitely with exponential backoff.
reconnectPeriod
Since version: 2.1 ∙ Type: duration ∙ Cardinality: Optional ∙ Default value: "PT30S"
Path: /updaters/[12]
Wait this amount of time before trying to reconnect to the PubSub subscription.
In case of a network error, the updater will try periodically to reconnect to the Google PubSub subscription.
subscriptionProjectName
Since version: 2.1 ∙ Type: string ∙ Cardinality: Required
Path: /updaters/[12]
The Google Cloud project that hosts the PubSub subscription.
During startup, the updater creates a PubSub subscription that listens to the PubSub topic that publishes SIRI-ET updates. This parameter specifies in which Google Cloud project the subscription will be created. The topic and the subscription can be hosted in two different projects.
fuzzyMatching
Since version: 2.11 ∙ Type: object ∙ Cardinality: Optional
Path: /updaters/[12]
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/[12]/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-google-pubsub-updater",
"feedId" : "feed_id",
"reconnectPeriod" : "5s",
"initialGetDataTimeout" : "1m20s",
"topicProjectName" : "google_pubsub_topic_project_name",
"subscriptionProjectName" : "google_pubsub_subscription_project_name",
"topicName" : "estimated_timetables",
"dataInitializationUrl" : "https://example.com/some/path",
"fuzzyTripMatching" : true,
"fuzzyMatching" : {
"timeTolerance" : "59s"
}
}
]
}