refactor: move lapin code into revolt-broker crate

This commit is contained in:
izzy
2025-06-28 17:23:44 +01:00
parent 85989a2138
commit 9d576d2430
15 changed files with 409 additions and 234 deletions

View File

@@ -28,6 +28,20 @@ port = 5672
username = "rabbituser"
password = "rabbitpass"
[rabbit.event_stream]
# Configuration for event brokerage
# Using default/direct exchange
exchange = ""
queue = "revolt.events"
# Number of channels that can be opened per single TCP connection
channels_per_conn = 128
# Maximum size of the stream
stream_max_length_bytes = 5_000_000_000
# Size of the Bloom filter
filter_size_bytes = 26
# Number of messages to prefetch
qos_prefetch = 100
[api]
[api.registration]

View File

@@ -108,12 +108,24 @@ pub struct Database {
pub redis: String,
}
#[derive(Deserialize, Debug, Clone)]
pub struct RabbitEventStream {
pub exchange: String,
pub queue: String,
pub channels_per_conn: usize,
pub stream_max_length_bytes: i64,
pub filter_size_bytes: i64,
pub qos_prefetch: u16,
}
#[derive(Deserialize, Debug, Clone)]
pub struct Rabbit {
pub host: String,
pub port: u16,
pub username: String,
pub password: String,
pub event_stream: RabbitEventStream,
}
#[derive(Deserialize, Debug, Clone)]