milestone: add runtime template state and dlq/retry broker topology
This commit is contained in:
@@ -31,6 +31,7 @@ use super::error::AmqpError;
|
||||
/// The name of the BEDS topic exchange. All events in the cluster are
|
||||
/// published to this exchange and routed by key to their consumers.
|
||||
pub const EXCHANGE_NAME: &str = "beds.events";
|
||||
pub const DLX_EXCHANGE_NAME: &str = "beds.dlx";
|
||||
|
||||
/// An authenticated AMQP connection with an open channel.
|
||||
///
|
||||
@@ -130,6 +131,18 @@ impl AmqpConnection {
|
||||
)
|
||||
.await?;
|
||||
|
||||
self.channel
|
||||
.exchange_declare(
|
||||
DLX_EXCHANGE_NAME,
|
||||
ExchangeKind::Topic,
|
||||
ExchangeDeclareOptions {
|
||||
durable: true,
|
||||
..Default::default()
|
||||
},
|
||||
FieldTable::default(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
pub mod connection;
|
||||
pub mod error;
|
||||
|
||||
pub use connection::{AmqpConnection, EXCHANGE_NAME};
|
||||
pub use connection::{AmqpConnection, DLX_EXCHANGE_NAME, EXCHANGE_NAME};
|
||||
pub use error::AmqpError; // will be used by broker pool error handling
|
||||
|
||||
use std::net::{TcpStream, ToSocketAddrs};
|
||||
|
||||
Reference in New Issue
Block a user