WebSocket Client
« Back to AWS Product Receiver
A WebSocketClient is used internally to connect to a web socket to retrieve products.
- anyMessageIntervalMillis
- When set to a non-zero value, determines the amount of time in milliseconds to wait until a message is received. If
- a message is not received within the timeframe, the client will disconnect and reconnect.
- Optional, Default:
0
- connectRetries
- The number of attempts to try to connect to the web socket endpoint.
- Optional, Default:
100000
- connectTimeout
- Millisecond amount of time to wait before retrying to connect to the url after a failed connection. Reconnecting will
- retry in an exponential format maxing out at 60 seconds between attempts.
- Optional, Default:
500
- pingIntervalMillis
- When set to a non-zero value, sets the time between pings sent to the server after connected.
- Optional, Default:
15000
- pingWaitMillis
- Millisecond amount of time to wait to receive a pong message from the connected web socket url.
- Optional, Default:
4000
- retryOnClose
- Boolean to determine if the websocket should reconnect after it closes or not. By default web sockets will disconnect
- on average every 2 hours.
- Optional, Default:
true
- url
- The url endpoint to connect to
- Required
Example configuration
1
2
3
4
5
6
7
8
9
10
11
[websocket_client]
type = gov.usgs.earthquake.distribution.WebSocketClient
# if a message is not received in 8 minutes, force a reconnect
anyMessageIntervalMillis = 480000
connectRetries = 100000
connectTimeout = 500
pingIntervalMillis = 15000
pingWaitMillis = 4000
retryOnClose = true
# The websocket url to use to receive from the Cloud PDL Hub
url = wss://earthquake.usgs.gov/pdl/east/products/notifications/subscribe
Last modified: Tue Sep 23 17:09:01 UTC 2025