Receive mode walkthrough
This walkthrough will guide you through running client to receive PDL messages.
This guide is based on running on a Debian based system.
1. Ensure the correct Java version is installed
See installing Java walkthrough
2. Ensure the PDL client is installed
See Downloading to choose a version to download. An example curl command to download version 3.0.2-beta
is below:
curl -qsSL https://code.usgs.gov/-/project/4689/uploads/dae3ab8b5e032d77afe5c2265fd22475/ProductClient.jar -o ProductClient.jar
3. Configure
Example configuration of a receiver and listener
Example config.ini
receivers = receiver
listeners = listener
loglevel = INFO
[receiver]
type = gov.usgs.earthquake.aws.AwsProductReceiver
index = receiver_index
trackingFileName = receiver_tracking.txt
storageDirectory = receiver_storage
url = wss://earthquake.usgs.gov/pdl/east/subscribe
initialCatchUpAge = 0.1
productsCreatedAfterClient = products_created_after_client
[products_created_after_client]
type = gov.usgs.earthquake.aws.ProductsCreatedAfterClient
batchLimit = 100
connectTimeout = 50000
maxRetryAttempts = 5
readTimeout = 30000
urlTemplate = https://earthquake.usgs.gov/pdl/east/products_created_after?created_after={CREATED_AFTER}&limit={BATCH_LIMIT}
[receiver_index]
type = gov.usgs.earthquake.aws.JsonNotificationIndex
[listener]
type = gov.usgs.earthquake.indexer.Indexer
indexFile = index_file.txt
storageDirectory = listener_storage
4. Run
java -jar ProductClient.jar --configFile=config.ini --receive
Note the exception in this output is expected and does not indicate a problem
Example output
# java -jar ProductClient.jar --configFile=config.ini --receive
Product Distribution Client
Version 3.0.2-beta 2024-08-19
INFO thread=1 Starting
Exception in thread "Thread-3" java.lang.NullPointerException: Cannot invoke "gov.usgs.earthquake.distribution.NotificationIndex.getName()" because "this.index" is null
at gov.usgs.earthquake.distribution.NotificationIndexCleanup.run(NotificationIndexCleanup.java:54)
at java.base/java.lang.Thread.run(Thread.java:840)
WARNING thread=1 [receiver_index] schema not found, creating
WARNING thread=1 [null] schema not found, creating
INFO thread=27 [receiver] onOpen connection_id=4e26312c-39b9-48a0-8add-b4a55bdcbb99 2024-08-28T19:56:53.008592001Z
INFO thread=27 [receiver] Starting catch up
INFO thread=1 Started
INFO thread=36 [PCATask] Received products_create_after payload, size=260940 bytes, duration=721 ms, count=100
INFO thread=37 [listener] indexed product id=urn:usgs-product:se:origin:se60502383:1724866415810, status=UPDATE
EVENT_ADDED null => se60502383
INFO thread=37 [listener] indexed product id=urn:usgs-product:ak:origin:AK024b2utook:1724866416263, status=UPDATE
EVENT_ADDED null => ak024b2utook
INFO thread=36 [PCATask] Received products_create_after payload, size=255867 bytes, duration=347 ms, count=100
INFO thread=37 [listener] indexed product id=urn:usgs-product:se:phase-data:se60502383:1724866415810, status=UPDATE
EVENT_UPDATED se60502383 => se60502383
INFO thread=37 [listener] indexed product id=urn:usgs-product:ak:phase-data:AK024b2utook:1724866416263, status=UPDATE
EVENT_UPDATED ak024b2utook => ak024b2utook
INFO thread=37 [listener] indexed product id=urn:usgs-product:ci:nearby-cities:ci40714375:1724866445919, status=UPDATE
PRODUCT_ADDED null => null
INFO thread=37 [listener] indexed product id=urn:usgs-product:ci:scitech-link:ci40714375-waveform_ci:1724866447226, status=UPDATE
PRODUCT_ADDED null => null
INFO thread=36 [PCATask] Received products_create_after payload, size=307169 bytes, duration=402 ms, count=100
INFO thread=37 [listener] indexed product id=urn:usgs-product:ci:origin:ci40714375:1724866445390, status=UPDATE
EVENT_ADDED null => ci40714375
INFO thread=37 [listener] indexed product id=urn:usgs-product:ci:phase-data:ci40714375:1724866445390, status=UPDATE
EVENT_UPDATED ci40714375 => ci40714375
Last modified: Fri Aug 30 20:09:40 UTC 2024