Class: CDC::SolidQueue::Configuration
- Inherits:
-
Object
- Object
- CDC::SolidQueue::Configuration
- Defined in:
- lib/cdc/solid_queue/configuration.rb
Overview
Runtime configuration for PostgreSQL CDC ingestion into Solid Queue.
The configuration object is intentionally small in the first release. It describes the target job class, Solid Queue queue name, ordering behavior, and PostgreSQL replication settings.
Constant Summary collapse
- SUPPORTED_SOURCE =
The only CDC source supported by the initial implementation.
:postgresql- ORDERING_KEYS =
Supported ordering scopes for serialized CDC events.
%i[identity primary_key relation transaction global none].freeze
- DOWNSTREAM_RUNTIMES =
Supported downstream execution runtimes for processor jobs.
%i[concurrent parallel direct].freeze
Instance Attribute Summary collapse
-
#checkpoint ⇒ Object
Returns the value of attribute checkpoint.
-
#downstream_options ⇒ Object
Returns the value of attribute downstream_options.
-
#downstream_processor ⇒ Object
Returns the value of attribute downstream_processor.
-
#downstream_runtime ⇒ Object
Returns the value of attribute downstream_runtime.
-
#ordering_key ⇒ Object
Returns the value of attribute ordering_key.
-
#postgresql ⇒ Object
Returns the value of attribute postgresql.
-
#preserve_order ⇒ Object
Returns the value of attribute preserve_order.
-
#processor_job ⇒ Object
Returns the value of attribute processor_job.
-
#queue ⇒ Object
Returns the value of attribute queue.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Build a configuration with safe defaults.
-
#source ⇒ Symbol
Return a normalized source name.
-
#validate! ⇒ true
Validate this configuration.
Constructor Details
#initialize ⇒ Configuration
Build a configuration with safe defaults.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cdc/solid_queue/configuration.rb', line 22 def initialize @processor_job = nil @queue = 'cdc' @preserve_order = true @ordering_key = :identity @postgresql = {} @checkpoint = Checkpoint.new @downstream_processor = nil @downstream_runtime = :concurrent @downstream_options = {} end |
Instance Attribute Details
#checkpoint ⇒ Object
Returns the value of attribute checkpoint.
18 19 20 |
# File 'lib/cdc/solid_queue/configuration.rb', line 18 def checkpoint @checkpoint end |
#downstream_options ⇒ Object
Returns the value of attribute downstream_options.
18 19 20 |
# File 'lib/cdc/solid_queue/configuration.rb', line 18 def @downstream_options end |
#downstream_processor ⇒ Object
Returns the value of attribute downstream_processor.
18 19 20 |
# File 'lib/cdc/solid_queue/configuration.rb', line 18 def downstream_processor @downstream_processor end |
#downstream_runtime ⇒ Object
Returns the value of attribute downstream_runtime.
18 19 20 |
# File 'lib/cdc/solid_queue/configuration.rb', line 18 def downstream_runtime @downstream_runtime end |
#ordering_key ⇒ Object
Returns the value of attribute ordering_key.
18 19 20 |
# File 'lib/cdc/solid_queue/configuration.rb', line 18 def ordering_key @ordering_key end |
#postgresql ⇒ Object
Returns the value of attribute postgresql.
18 19 20 |
# File 'lib/cdc/solid_queue/configuration.rb', line 18 def postgresql @postgresql end |
#preserve_order ⇒ Object
Returns the value of attribute preserve_order.
18 19 20 |
# File 'lib/cdc/solid_queue/configuration.rb', line 18 def preserve_order @preserve_order end |
#processor_job ⇒ Object
Returns the value of attribute processor_job.
18 19 20 |
# File 'lib/cdc/solid_queue/configuration.rb', line 18 def processor_job @processor_job end |
#queue ⇒ Object
Returns the value of attribute queue.
18 19 20 |
# File 'lib/cdc/solid_queue/configuration.rb', line 18 def queue @queue end |
Instance Method Details
#source ⇒ Symbol
Return a normalized source name.
54 55 56 57 |
# File 'lib/cdc/solid_queue/configuration.rb', line 54 def source configured = @postgresql.fetch(:source, SUPPORTED_SOURCE) configured.to_sym end |
#validate! ⇒ true
Validate this configuration.
rubocop:disable Naming/PredicateMethod
40 41 42 43 44 45 46 47 48 |
# File 'lib/cdc/solid_queue/configuration.rb', line 40 def validate! validate_processor_job! validate_queue! validate_ordering_key! validate_postgresql! validate_checkpoint! validate_downstream! true end |