diff --git a/ofborg/src/bin/builder.rs b/ofborg/src/bin/builder.rs index 0be9718..7c2475f 100644 --- a/ofborg/src/bin/builder.rs +++ b/ofborg/src/bin/builder.rs @@ -42,7 +42,7 @@ fn main() { channel.basic_prefetch(1).unwrap(); channel .declare_exchange(easyamqp::ExchangeConfig { - exchange: "build-inputs".to_owned(), + exchange: "build-jobs".to_owned(), exchange_type: easyamqp::ExchangeType::Fanout, passive: false, durable: true, @@ -68,7 +68,7 @@ fn main() { channel .bind_queue(easyamqp::BindQueueConfig { queue: format!("build-inputs-{}", cfg.nix.system.clone()), - exchange: "build-inputs".to_owned(), + exchange: "build-jobs".to_owned(), routing_key: None, no_wait: false, arguments: None, diff --git a/ofborg/src/bin/log-message-collector.rs b/ofborg/src/bin/log-message-collector.rs index f6eb773..f40b7e9 100644 --- a/ofborg/src/bin/log-message-collector.rs +++ b/ofborg/src/bin/log-message-collector.rs @@ -23,29 +23,40 @@ fn main() { let mut channel = session.open_channel(1).unwrap(); - let queue_name = channel - .queue_declare( - "", - false, // passive - false, // durable - true, // exclusive - true, // auto_delete - false, //nowait - Table::new(), - ) - .expect("Failed to declare an anon queue for log collection!") - .queue; - channel - .queue_bind( - queue_name.as_ref(), - "logs", - "*.*".as_ref(), - false, - Table::new(), - ) + .declare_exchange(easyamqp::ExchangeConfig { + exchange: "logs".to_owned(), + exchange_type: easyamqp::ExchangeType::Topic, + passive: false, + durable: true, + auto_delete: false, + no_wait: false, + internal: false, + arguments: None, + }) .unwrap(); + let queue_name = channel + .declare_queue(easyamqp::QueueConfig { + queue: "".to_owned(), + passive: false, + durable: false, + exclusive: true, + auto_delete: true, + no_wait: false, + arguments: None, + }) + .unwrap(); + + channel + .bind_queue(easyamqp::BindQueueConfig { + queue: queue_name.clone(), + exchange: "logs".to_owned(), + routing_key: Some("*.*".to_owned()), + no_wait: false, + arguments: None, + }) + .unwrap(); channel .consume(