conductor-oss/conductor · error · IllegalArgumentException

Hosts are undefined

Error message

Hosts are undefined

What it means

Builder.buildAddressesFromHosts() reads AMQPEventQueueProperties.getHosts(); if it is null or empty (StringUtils.isEmpty) the Builder constructor throws IllegalArgumentException before any queue is built. The hosts string is later parsed by Address.parseAddresses, so it must be non-empty first.

Source

Thrown at amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/AMQPObservableQueue.java:463

        private final int batchSize;
        private final int pollTimeInMS;
        private final ConnectionFactory factory;
        private final AMQPEventQueueProperties properties;

        public Builder(AMQPEventQueueProperties properties) {
            this.properties = properties;
            this.addresses = buildAddressesFromHosts();
            this.factory = buildConnectionFactory();
            // messages polling settings
            this.batchSize = properties.getBatchSize();
            this.pollTimeInMS = (int) properties.getPollTimeDuration().toMillis();
        }

        private Address[] buildAddressesFromHosts() {
            // Read hosts from config
            final String hosts = properties.getHosts();
            if (StringUtils.isEmpty(hosts)) {
                throw new IllegalArgumentException("Hosts are undefined");
            }
            return Address.parseAddresses(hosts);
        }

        private ConnectionFactory buildConnectionFactory() {
            final ConnectionFactory factory = new ConnectionFactory();
            // Get rabbitmq username from config
            final String username = properties.getUsername();
            if (StringUtils.isEmpty(username)) {
                throw new IllegalArgumentException("Username is null or empty");
            } else {
                factory.setUsername(username);
            }
            // Get rabbitmq password from config
            final String password = properties.getPassword();
            if (StringUtils.isEmpty(password)) {
                throw new IllegalArgumentException("Password is null or empty");
            } else {

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Set the hosts property to a non-empty, comma-separated list of host[:port] entries.
  2. Confirm the property key matches what AMQPEventQueueProperties.getHosts() binds to.
  3. Fail fast at startup with a clear config check rather than at Builder construction.

Example fix

# before: hosts not set -> 'Hosts are undefined'
# (no conductor.amqp.hosts)

# after: set a non-empty host list
conductor.amqp.hosts=rmq1:5672,rmq2:5672
Defensive patterns

Strategy: validation

Validate before calling

// Validate the hosts property before constructing the Builder
if (StringUtils.isEmpty(properties.getHosts())) {
    throw new IllegalArgumentException("conductor.amqp.hosts must be set (host[:port],...)");
}

Prevention

When it happens

Trigger: Constructing `new AMQPObservableQueue.Builder(properties)` when the AMQP hosts property is missing or blank.

Common situations: The AMQP hosts property (e.g. conductor.amqp.hosts) is not set in the environment/profile; the property key is misspelled; the value is an empty string.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/9b12aeab52d56a51. Report an issue: GitHub.