Skip to content

Bug (TimelyProperties) - enabled endpoint is not validated #3758

Description

@arthurianresolve

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions