mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-17 05:05:03 +01:00
implement binding
This commit is contained in:
parent
6f6c0848ac
commit
a1fa68396f
9 changed files with 181 additions and 77 deletions
|
|
@ -1,7 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use haesli_core::{
|
||||
amqp_todo,
|
||||
connection::Channel,
|
||||
error::{ChannelException, ConException},
|
||||
message::Message,
|
||||
|
|
@ -18,21 +17,17 @@ pub fn publish(channel_handle: Channel, message: Message) -> Result<()> {
|
|||
|
||||
let routing = &message.routing;
|
||||
|
||||
if !routing.exchange.is_empty() {
|
||||
amqp_todo!();
|
||||
}
|
||||
|
||||
let global_data = global_data.lock();
|
||||
|
||||
let exchange = &message.routing.exchange;
|
||||
let exchange = &routing.exchange;
|
||||
|
||||
let exchange = global_data
|
||||
.exchanges
|
||||
.get(exchange.as_str())
|
||||
.ok_or(ChannelException::NotFound)?;
|
||||
|
||||
let queues = routing::route_message(exchange, &message.routing.routing_key)
|
||||
.ok_or(ChannelException::NotFound)?; // todo this isn't really correct but the tests pass ✔️
|
||||
let queues =
|
||||
routing::route_message(exchange, &routing.routing_key).ok_or(ChannelException::NotFound)?; // todo this isn't really correct but the tests pass ✔️
|
||||
|
||||
for queue in queues {
|
||||
queue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue