Reliable Listener Configuration

« Back to Documentation

PDL offers several options for more reliable processing of notifications and products, but these are not enabled by default and require user configuration.

Listener configuration

It is recommended that users configure a listenerIndex, maxTries, and retryDelay, for each listener to ensure it reliably receives and processes notifications of new products.

listenerIndex

Note: while this is effective in reprocessing notifications that failed the first time, it requires a process restart

listenerIndex
a notification index specific to a listener, that is used to keep track of notifications that have been successfully processed

At process start, when a listener has a listenerIndex configured, each notification receiver will requeue all notifications it has received for processing by the listener. When processing a notification, the listener then checks whether it has already processed the product, effectively requeuing any products that may have failed to process on the first attempt.

maxTries and retryDelay

maxTries and retryDelay settings control how a listener handles notifications that fail to process on the first attempt; and ensure a notification is processed without requiring a process restart.

maxTries
defines the number of delivery attempts PDL should make for a specific listener; and defaults to 1.
retryDelay
defines how many milliseconds to wait between delivery attempts that fail; and defaults to 300000ms (5 minutes).

Configuration Example

The lines in bold below show an example of how these properties can be added to a listener. In general, any type of listener can configure these properties.

[LISTENERNAME]
type = gov.usgs.earthquake.distribution.ExternalNotificationListener
command = /bin/echo
includeTypes = origin
listenerIndexFile = data/LISTENERNAME_listener.db
maxTries = 3
retryDelay = 300000
	

See NotificationListener configuration for more information