Skip to content

Commit

Permalink
new: Simplify overseer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Jul 19, 2021
1 parent 1111e67 commit 246fc59
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@
RABBITMQ_HOSTNAME: ENV['RABBITMQ_HOSTNAME'],
RABBITMQ_USERNAME: ENV['RABBITMQ_USERNAME'],
RABBITMQ_PASSWORD: ENV['RABBITMQ_PASSWORD'],
EXCHANGE_NAME: ENV['EXCHANGE_NAME'],
DURABLE_QUEUE_NAME: ENV['DURABLE_QUEUE_NAME'],
BINDING_KEYS: ENV['BINDING_KEYS'],
DEFAULT_BINDING_KEY: ENV['DEFAULT_BINDING_KEY']
EXCHANGE_NAME: 'ontrack',
DURABLE_QUEUE_NAME: 'q.tasks',
BINDING_KEYS: 'task.submission',
DEFAULT_BINDING_KEY: 'task.submission'
}

assessment_results_publisher_config = {
RABBITMQ_HOSTNAME: ENV['RABBITMQ_HOSTNAME'],
RABBITMQ_USERNAME: ENV['RABBITMQ_USERNAME'],
RABBITMQ_PASSWORD: ENV['RABBITMQ_PASSWORD'],
EXCHANGE_NAME: ENV['EXCHANGE_NAME'],
DURABLE_QUEUE_NAME: 'assessment_results',
EXCHANGE_NAME: 'ontrack',
DURABLE_QUEUE_NAME: 'q.overseer',
# Publisher specific key
# Note: `*.result` works too, but it makes no sense using that.
ROUTING_KEY: 'assessment.result'
ROUTING_KEY: 'overseer.result'
}

assessment_results_publisher = Publisher.new assessment_results_publisher_config

# Register subscriber for task submissions, runs overseer receive, and publishes results to assessment_results_publisher
register_subscriber(subscriber_config,
method(:receive),
assessment_results_publisher)

0 comments on commit 246fc59

Please sign in to comment.