-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from bkearns/master
Added qos (with a prefetch shortcut) and exchange bindings.
- Loading branch information
Showing
5 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
language: rust | ||
rust: nightly | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
extern crate amqp; | ||
|
||
use amqp::session::Options; | ||
use amqp::session::Session; | ||
use amqp::protocol; | ||
use amqp::table; | ||
use amqp::basic::Basic; | ||
use std::default::Default; | ||
|
||
|
||
fn main() { | ||
let mut session = Session::new(Options{.. Default::default()}).ok().unwrap(); | ||
let mut channel = session.open_channel(1).ok().unwrap(); | ||
println!("Openned channel: {:?}", channel.id); | ||
|
||
let exchange1 = "test_exchange"; | ||
let exchange2 = "test_exchange2"; | ||
let exchange_type = "topic"; | ||
|
||
//queue: &str, passive: bool, durable: bool, exclusive: bool, auto_delete: bool, nowait: bool, arguments: Table | ||
let exchange_declare1 = channel.exchange_declare(exchange1, exchange_type, | ||
false, true, false, false, false, table::new()); | ||
|
||
println!("Exchange declare: {:?}", exchange_declare1); | ||
let exchange_declare2 = channel.exchange_declare(exchange2, exchange_type, | ||
false, true, false, false, false, table::new()); | ||
println!("Exchange declare: {:?}", exchange_declare2); | ||
|
||
let bind_reply = channel.exchange_bind(exchange1, exchange2, "#", table::new()); | ||
println!("Exchange bind: {:?}", bind_reply); | ||
|
||
|
||
channel.close(200, "Bye".to_string()); | ||
session.close(200, "Good Bye".to_string()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters