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
Instance Attribute Summary collapse
-
#checkpoint ⇒ Object
Returns the value of attribute checkpoint.
-
#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.
19 20 21 22 23 24 25 26 |
# File 'lib/cdc/solid_queue/configuration.rb', line 19 def initialize @processor_job = nil @queue = 'cdc' @preserve_order = true @ordering_key = :identity @postgresql = {} @checkpoint = Checkpoint.new end |
Instance Attribute Details
#checkpoint ⇒ Object
Returns the value of attribute checkpoint.
16 17 18 |
# File 'lib/cdc/solid_queue/configuration.rb', line 16 def checkpoint @checkpoint end |
#ordering_key ⇒ Object
Returns the value of attribute ordering_key.
16 17 18 |
# File 'lib/cdc/solid_queue/configuration.rb', line 16 def ordering_key @ordering_key end |
#postgresql ⇒ Object
Returns the value of attribute postgresql.
16 17 18 |
# File 'lib/cdc/solid_queue/configuration.rb', line 16 def postgresql @postgresql end |
#preserve_order ⇒ Object
Returns the value of attribute preserve_order.
16 17 18 |
# File 'lib/cdc/solid_queue/configuration.rb', line 16 def preserve_order @preserve_order end |
#processor_job ⇒ Object
Returns the value of attribute processor_job.
16 17 18 |
# File 'lib/cdc/solid_queue/configuration.rb', line 16 def processor_job @processor_job end |
#queue ⇒ Object
Returns the value of attribute queue.
16 17 18 |
# File 'lib/cdc/solid_queue/configuration.rb', line 16 def queue @queue end |
Instance Method Details
#source ⇒ Symbol
Return a normalized source name.
47 48 49 50 |
# File 'lib/cdc/solid_queue/configuration.rb', line 47 def source configured = @postgresql.fetch(:source, SUPPORTED_SOURCE) configured.to_sym end |
#validate! ⇒ true
Validate this configuration.
rubocop:disable Naming/PredicateMethod
34 35 36 37 38 39 40 41 |
# File 'lib/cdc/solid_queue/configuration.rb', line 34 def validate! validate_processor_job! validate_queue! validate_ordering_key! validate_postgresql! validate_checkpoint! true end |