builders: correct the definition

This commit is contained in:
Graham Christensen 2018-03-02 19:41:13 -05:00
parent 7eb39889c3
commit 7f0c39a315
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 33 additions and 22 deletions

View file

@ -42,7 +42,7 @@ fn main() {
channel.basic_prefetch(1).unwrap(); channel.basic_prefetch(1).unwrap();
channel channel
.declare_exchange(easyamqp::ExchangeConfig { .declare_exchange(easyamqp::ExchangeConfig {
exchange: "build-inputs".to_owned(), exchange: "build-jobs".to_owned(),
exchange_type: easyamqp::ExchangeType::Fanout, exchange_type: easyamqp::ExchangeType::Fanout,
passive: false, passive: false,
durable: true, durable: true,
@ -68,7 +68,7 @@ fn main() {
channel channel
.bind_queue(easyamqp::BindQueueConfig { .bind_queue(easyamqp::BindQueueConfig {
queue: format!("build-inputs-{}", cfg.nix.system.clone()), queue: format!("build-inputs-{}", cfg.nix.system.clone()),
exchange: "build-inputs".to_owned(), exchange: "build-jobs".to_owned(),
routing_key: None, routing_key: None,
no_wait: false, no_wait: false,
arguments: None, arguments: None,

View file

@ -23,29 +23,40 @@ fn main() {
let mut channel = session.open_channel(1).unwrap(); 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 channel
.queue_bind( .declare_exchange(easyamqp::ExchangeConfig {
queue_name.as_ref(), exchange: "logs".to_owned(),
"logs", exchange_type: easyamqp::ExchangeType::Topic,
"*.*".as_ref(), passive: false,
false, durable: true,
Table::new(), auto_delete: false,
) no_wait: false,
internal: false,
arguments: None,
})
.unwrap(); .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 channel
.consume( .consume(