Skip to content

Commit

Permalink
new command line parameter: kafka_advertised_listener_url
Browse files Browse the repository at this point in the history
  • Loading branch information
shortishly committed Sep 24, 2024
1 parent ca3b3df commit e5c16fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tansu-server/src/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub struct Broker<G, S> {
context: Raft,
applicator: Applicator,
listener: Url,
advertised_listener: Url,
#[allow(dead_code)]
rack: Option<String>,
storage: S,
Expand All @@ -87,6 +88,7 @@ where
context: Raft,
applicator: Applicator,
listener: Url,
advertised_listener: Url,
rack: Option<String>,
storage: S,
groups: G,
Expand All @@ -100,6 +102,7 @@ where
context,
applicator,
listener,
advertised_listener,
rack,
storage,
groups,
Expand All @@ -119,8 +122,12 @@ where
incarnation_id: self.incarnation_id,
listeners: [Listener {
name: "broker".into(),
host: self.listener.host_str().unwrap_or("localhost").to_owned(),
port: self.listener.port().unwrap_or(9092),
host: self
.advertised_listener
.host_str()
.unwrap_or("localhost")
.to_owned(),
port: self.advertised_listener.port().unwrap_or(9092),
security_protocol: 0,
}]
.into(),
Expand Down
4 changes: 4 additions & 0 deletions tansu-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ struct Cli {
#[arg(long, default_value = "tcp://0.0.0.0:9092")]
kafka_listener_url: Url,

#[arg(long, default_value = "tcp://0.0.0.0:9092")]
kafka_advertised_listener_url: Url,

#[arg(long, default_value = "pg=postgres://postgres:postgres@localhost")]
storage_engine: KeyValue<String, Url>,

Expand Down Expand Up @@ -185,6 +188,7 @@ async fn main() -> Result<()> {
raft.clone(),
applicator.clone(),
args.kafka_listener_url,
args.kafka_advertised_listener_url,
args.kafka_rack,
storage,
groups,
Expand Down

0 comments on commit e5c16fb

Please sign in to comment.