External Notification Listener

« Back to receiving

The external notification listener provides a method for configuring external processes to be triggered via command-line invocation when products are received. In addition to the standard listener properties, this type of listener accepts the following specific properties:

command
The executable command to be invoked when a product is to be processed.
storage
Name of a separate configuration sub-section defining a FileProductStorage implementation to used by the external listener.
One of storage or storageDirectory must be specified. It is a configuration to provide both.
storageDirectory
Directory to use for creating a default FileProductStorage for use with this external listener.
One of storage or storageDirectory must be specified. It is a configuration to provide both.

Example configuration

Note: This is a fully configured ExternalNotificationListener using default values for optional parameters

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
listeners = external_listener

[external_listener]
type = gov.usgs.earthquake.distribution.ExternalNotificationListener
# the following configuration parameters are supported by all listeners
cleanupInterval = 3600000
concurrentProducts = 1
excludePaths = 
excludeSources = 
excludeTypes =
includeActuals = true
includeDevelopments = false
includeInternals = false
includePaths = 
includeScenarios = false
includeSources = 
includeTests = false
includeTypes = 
listenerIndex = listener_index
maxTries = 1
processDuplicates = false
retryDelay = 300000
timeout = 0
# the following configuration parameters are specific to an ExternalNotificatoinListener
command = /bin/echo
storage = listener_storage

[listener_index]
type = gov.usgs.earthquake.aws.JsonNotificationIndex
table = listener_index

[listener_storage]
type = gov.usgs.earthquake.distribution.FileProductStorage
directory = listener_storage

External Command Line Options

The external command will be invoked with the following command line options when a product is to be processed. The command should be able to parse any/all of these options as necessary to process the product.

--directory=[/path/to/file]
An absolute path to where product data is stored related to this notification.
--type=[type]
The type of product associated with this notification.
--code=[code]
The product code, without source network, for the product associated with this notification.
--source=[source]
The source network for the product associated with this notification.
--updateTime=[time]
The update time of the product associated with this notification in ISO 8601 date format. (e.g., 2000-01-01T00:00:00Z)
--status=[status]
The status of the product related to this notification. It can be any of the following:
  • UPDATE: The product has been created or updates an existing product.
  • DELETE: The product has been marked to be deleted.
--delete
(Optional) This argument will appear only when the value of the --status argument is “DELETE”.
"--property-[name]=[value]"
(Optional) A series of these arguments will be appended, one for each defined property in the summary of this product.
"--link-[relation]=[value]"
(Optional) A series of these arguments will be appended, one for each defined link in the summary of this product.
--content
(Optional) Indicates that non-file content will be sent to the command over its stdin.
--contentType=[type]
(Optional) Indicates the MIME type of the content that will be sent over stdin. Will always appear when the –content argument appears.
--signature=[signature]
(Optional) The signature key of the product creator, if it was provided.



Last modified: Mon Jun 9 21:29:31 UTC 2025