Issue
TimelyProperties does not validate the endpoint when Timely output is enabled.
Problem
The configuration allows a null host and does not validate the port:
|
@ConfigurationProperties(prefix = "datawave.query.metric.timely") |
|
public class TimelyProperties { |
|
|
|
private boolean enabled = false; |
|
private String host = null; |
|
private Protocol protocol = Protocol.TCP; |
|
private int port = 4242; |
|
private Map<String,String> tags = new LinkedHashMap<>(); |
With Timely enabled, an incomplete endpoint can reach client setup.
TCP and UDP then handle the missing host in different ways. This can connect to an unintended local endpoint or leave Timely output unusable.
Expected behavior
When Timely output is enabled:
- the host should not be blank
- the port should be from
1 to 65535
- the protocol should be set
When Timely output is disabled, the endpoint may be omitted.
Actual behavior
Invalid enabled settings can pass configuration binding and fail later during client setup or use.
Affected components
- query-metric service Timely TCP output
- query-metric service Timely UDP output
Suggested fix
Add conditional configuration validation for the enabled Timely endpoint.
Fail application startup with a clear binding message when enabled settings are invalid.
Test
Use ApplicationContextRunner to check:
- enabled with a missing or blank host fails
- enabled with an invalid port fails
- enabled with no protocol fails
- disabled with no endpoint succeeds
- valid TCP and UDP settings succeed
Issue
TimelyPropertiesdoes not validate the endpoint when Timely output is enabled.Problem
The configuration allows a null host and does not validate the port:
datawave/microservices/services/query-metric/service/src/main/java/datawave/microservice/querymetric/config/TimelyProperties.java
Lines 8 to 15 in c3b731d
With Timely enabled, an incomplete endpoint can reach client setup.
TCP and UDP then handle the missing host in different ways. This can connect to an unintended local endpoint or leave Timely output unusable.
Expected behavior
When Timely output is enabled:
1to65535When Timely output is disabled, the endpoint may be omitted.
Actual behavior
Invalid enabled settings can pass configuration binding and fail later during client setup or use.
Affected components
Suggested fix
Add conditional configuration validation for the enabled Timely endpoint.
Fail application startup with a clear binding message when enabled settings are invalid.
Test
Use
ApplicationContextRunnerto check: