apache/seatunnel · error · IllegalArgumentException

Option 'max_in_flight' must be greater than zero

Error message

Option 'max_in_flight' must be greater than zero

What it means

Config validation in AzureQueueSinkConfig.validate: max_in_flight controls the number of concurrent outstanding send operations to Azure Queue Storage; zero or a negative value would deadlock or be rejected by the client, so it is rejected at sink initialization.

Source

Thrown at seatunnel-connectors-v2/connector-azure-queue-storage/src/main/java/org/apache/seatunnel/connectors/seatunnel/azure/queue/config/AzureQueueSinkConfig.java:74

                        .format(config.get(AzureQueueStorageSinkOptions.FORMAT))
                        .fieldDelimiter(config.get(AzureQueueStorageSinkOptions.FIELD_DELIMITER))
                        .messageEncoding(config.get(AzureQueueStorageSinkOptions.MESSAGE_ENCODING))
                        .maxInFlight(config.get(AzureQueueStorageSinkOptions.MAX_IN_FLIGHT))
                        .operationTimeoutMillis(
                                config.get(AzureQueueStorageSinkOptions.OPERATION_TIMEOUT_MS))
                        .build();
        sinkConfig.validate();
        return sinkConfig;
    }

    private void validate() {
        AzureQueueConfigValidator.validateClient(this);

        if (format == MessageFormat.TEXT && fieldDelimiter.isEmpty()) {
            throw new IllegalArgumentException("Option 'field_delimiter' cannot be empty");
        }
        if (maxInFlight <= 0) {
            throw new IllegalArgumentException("Option 'max_in_flight' must be greater than zero");
        }
        if (operationTimeoutMillis <= 0) {
            throw new IllegalArgumentException(
                    "Option 'operation_timeout_ms' must be greater than zero");
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set max_in_flight to a positive integer (e.g. 100)
  2. Check the variable or expression feeding the option for a zero/negative value
  3. Remove the option to use the documented default

Example fix

// before
max_in_flight = 0
// after
max_in_flight = 100
Defensive patterns

Strategy: validation

Validate before calling

java
if (maxInFlight <= 0) {
    maxInFlight = 100;
}

Try / catch

java
try {
    AzureQueueSinkConfig.from(config);
} catch (IllegalArgumentException e) {
    if (e.getMessage().contains("max_in_flight")) {
        log.error("max_in_flight must be a positive integer");
    } else { throw e; }
}

Prevention

When it happens

Trigger: Building AzureQueueSinkConfig via from() with max_in_flight <= 0, e.g. max_in_flight = 0 or a negative value from a variable.

Common situations: User thought 0 means 'unlimited'; a computed config subtracted a value incorrectly; a template placeholder defaulted to 0.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/4ccc4466c0b32a4d. Report an issue: GitHub.