File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ TIPS_INGRESS_METRICS_ADDR=0.0.0.0:9002
1414TIPS_INGRESS_BLOCK_TIME_MILLISECONDS = 2000
1515TIPS_INGRESS_METER_BUNDLE_TIMEOUT_MS = 2000
1616TIPS_INGRESS_MAX_BUFFERED_METER_BUNDLE_RESPONSES = 100
17- TIPS_INGRESS_BUILDER_RPC = http://localhost:2222
17+ TIPS_INGRESS_BUILDER_RPCS = http://localhost:2222
1818
1919# Audit service configuration
2020TIPS_AUDIT_KAFKA_PROPERTIES_FILE = /app/docker/audit-kafka-properties
Original file line number Diff line number Diff line change @@ -64,11 +64,12 @@ async fn main() -> anyhow::Result<()> {
6464 let ( audit_tx, audit_rx) = mpsc:: unbounded_channel :: < BundleEvent > ( ) ;
6565 connect_audit_to_publisher ( audit_rx, audit_publisher) ;
6666
67- // TODO: when we have multiple builders we can make `builder_rx` mutable and do `.subscribe()` to have multiple consumers
68- // of this channel.
69- let ( builder_tx, builder_rx) =
67+ let ( builder_tx, _) =
7068 broadcast:: channel :: < MeterBundleResponse > ( config. max_buffered_meter_bundle_responses ) ;
71- connect_ingress_to_builder ( builder_rx, config. builder_rpc ) ;
69+ config. builder_rpcs . iter ( ) . for_each ( |builder_rpc| {
70+ let builder_rx = builder_tx. subscribe ( ) ;
71+ connect_ingress_to_builder ( builder_rx, builder_rpc. clone ( ) ) ;
72+ } ) ;
7273
7374 let service = IngressService :: new (
7475 provider,
Original file line number Diff line number Diff line change @@ -122,9 +122,9 @@ pub struct Config {
122122 ) ]
123123 pub meter_bundle_timeout_ms : u64 ,
124124
125- /// URL of the builder RPC service for setting metering information
126- #[ arg( long, env = "TIPS_INGRESS_BUILDER_RPC " ) ]
127- pub builder_rpc : Url ,
125+ /// URLs of the builder RPC service for setting metering information
126+ #[ arg( long, env = "TIPS_INGRESS_BUILDER_RPCS " ) ]
127+ pub builder_rpcs : Vec < Url > ,
128128
129129 /// Maximum number of `MeterBundleResponse`s to buffer in memory
130130 #[ arg(
You can’t perform that action at this time.
0 commit comments