Class: ActiveJob::Temporal::ConfigValidator Private

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/activejob/temporal/configuration.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Validates ActiveJob::Temporal configuration.

This class uses ActiveModel::Validations to provide declarative validation with i18n support. Attributes are automatically synchronized from the configuration via metaprogramming.

**Validation Rules:**

  • ‘target`: Presence + host:port format validation

  • ‘namespace`: Presence + alphanumeric/hyphens/underscores format

  • ‘default_activity_timeout`: Duration type + positive value

  • ‘default_retry_initial_interval`: Duration type + positive value

  • ‘default_retry_backoff`: Numericality >= 1.0

  • ‘default_retry_max_attempts`: Numericality >= 0

  • ‘max_payload_size_kb`: Numericality 1..2GB

  • ‘max_concurrent_activities`: Numericality > 0

  • ‘max_concurrent_workflow_tasks`: Numericality > 0

  • ‘workflow_id_generator`: Optional callable

  • ‘middleware_chain`: Callable chain with registration support

rubocop:disable Metrics/ClassLength

Examples:

Using ConfigValidator directly

validator = ConfigValidator.new
validator.target = "localhost:7233"
validator.namespace = "production"
if validator.valid?
  puts "Configuration is valid"
else
  puts validator.errors.full_messages
end

See Also:

  • ActiveJob::Temporal::Configuration.validate!