Running an InputWedge

« Back to user guide

The InputWedge is used to poll a directory for QuakeML files to generate products from them or read a directory that contains a product. It will send the derived products via a configured sender. Polling may introduce latency between when a product is created and when it is sent, and does not provide direct feedback (other than log files) about the status of sent products.

It can be run and configured with a combination of cli flags and a config file.

CLI flags

–help
Display help message
–file=FILE
Parse and send one file
–poll
Run continuously, checking POLLDIR for files
–test
Optional. Print generated products to console for testing, ignores any
configured senders
–senders=SENDERS
Optional. Comma delimited list of senders from the config file,
this will override any senders configured in the config file.
To be used when a subset of senders from the config file is wanted to be used
–attach=ATTACH
Optional. Attach a file or directory to one generated product, repeatable
directory trees are preserved and each path must be unique. If more than
one product is generated an exception will be thrown.
This is only supported when the --file= argument is given (not in poll mode)

Config file properties

parserClass
Optional. Class that implements gov.usgs.earthquake.distribution.ProductCreator
Default gov.usgs.earthquake.distribution.QuakemlProductCreator
validate
Optional. Enables the parser class to validate products
Default false
sendOriginWhenPhasesExist
Optional. When a phase-data product is generated, also send an origin product
without the phase data
Default false
sendMechanismWhenPhasesExist
Optional. When a phase-data product is generated, also send focal mechanism
products without the phase data
Default false
directory
Optional. Directory to poll for messages
Default is polldir
interval
Optional. Milliseconds between polling
Default is 1000
pollCarefully
Optional. When enabled polling will wait until the file is at least
pollInterval ms old in case it is still being written
Default false
oldinputdir
Optional. Directory for files that were processed
Default is oldinput
errordir
Optional. Directory for files that weren’t processed
Default is errordir
createInternalProducts
Optional. Use the product type prefix ‘internal-‘ for all generated products
Default false
createScenarioProducts
Optional. Use the product type suffix ‘-scenario’ for all generated products
Default false
senders
A comma-separated list of named senders to use when sending products.
Each value in the list should be the name of a configuration sub-section
within the configuration file.
See: sending for more information on sending
products.
privateKeyFile
Optional. Path of openssh private key used to sign products
signatureVersion
Optional. Version of the signature algorithm to use when signing the products
Default is v2
parallelSend
Optional. Send to servers in parallel
Default true
parallelSendTimeout
Optional. Timeout for parallel sends in seconds
Default 300

Example config.ini configuration

loglevel = INFO

senders = sender_aws

privateKeyFile = ./private-key
signatureVersion = v2

parser = gov.usgs.earthquake.distribution.QuakemlProductCreator
createInternalProducts = false
createScenarioProducts = false
sendOriginWhenPhasesExist = true
sendMechanismWhenPhasesExist = true
poller = directory_poller

connectTimeout = 15000
parallelSend = true
parallelSendTimeout = 300

[sender_aws]
type = gov.usgs.earthquake.aws.AwsProductSender
url = https://earthquake.usgs.gov/pdl/east/

[directory_poller]
type = gov.usgs.util.DirectoryPoller
pollDirectory = pollDirectory
oldInputDirectory = oldInputDirectory
errorDirectory = errorDirectory
interval = 10000
pollCarefully = true

Example poll run command with config file

java -jar ProductClient.jar --mainclass=gov.usgs.earthquake.distribution.InputWedge --configFile=config.ini --poll

Example output

Putting a quakeml.xml file into the poll directory will result in the following

INFO    thread=20       Reading file quakeml.xml
WARNING thread=20       Missing eventParameters creationTime, using now for update time
INFO    thread=22       [sender_aws] send product total urn:usgs-product:source:origin:code:1737571158561 (1330 ms)
INFO    thread=28       [sender_aws] send product total urn:usgs-product:source:phase-data:code:1737571158561 (496 ms)
INFO    thread=20       generated 2 products: 2 sent, 0 partially sent, 0 failed to send

Putting a directory with a product.xml file into the poll directory will result in a single product being sent. This example uses a DYFI product.

INFO    thread=22       Reading file dyfi_product
INFO    thread=23       [sender_aws] send product total urn:usgs-product:source:dyfi:code:1738185849459 (7194 ms)
INFO    thread=22       generated 1 products: 1 sent, 0 partially sent, 0 failed to send

Example single file run command

java -jar ProductClient.jar --mainclass=gov.usgs.earthquake.distribution.InputWedge --configFile=config.ini --file=quakeml.xml

INFO    thread=1        Reading file quakeml.xml
INFO    thread=20       [sender_aws] send product total urn:usgs-product:source:origin:code:1738273926061 (2163 ms)
INFO    thread=1        generated 1 products: 1 sent, 0 partially sent, 0 failed to send



Last modified: Wed Feb 5 22:45:07 UTC 2025