Skip to content

Commit d5cb60f

Browse files
Revisit federation-related CLI options
1 parent c75110d commit d5cb60f

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

src/cli.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,13 +1674,11 @@ fn federation_subcommands() -> [Command; 5] {
16741674
Arg::new("queue_name")
16751675
.long("queue-name")
16761676
.help("queue federation: the queue name to use on the upstream. Defaults to the federated queue name")
1677-
.conflicts_with("exchange")
16781677
)
16791678
.arg(
16801679
Arg::new("consumer_tag")
16811680
.long("consumer-tag")
16821681
.help("Custom consumer tag to use for the internal federation consumer")
1683-
.conflicts_with("exchange")
16841682
.requires("queue_name")
16851683
)
16861684
.arg(
@@ -1700,14 +1698,18 @@ fn federation_subcommands() -> [Command; 5] {
17001698
.long("max_hops")
17011699
.default_value("1")
17021700
.value_parser(value_parser!(u8))
1703-
.conflicts_with("queue_name")
1701+
)
1702+
.arg(
1703+
Arg::new("bind_nowait")
1704+
.long("bind-using-nowait")
1705+
.default_value("false")
1706+
.value_parser(value_parser!(bool))
17041707
)
17051708
.arg(
17061709
Arg::new("resource_cleanup_mode")
17071710
.long("resource-cleanup-mode")
17081711
.default_value("default")
17091712
.value_parser(value_parser!(FederationResourceCleanupMode))
1710-
.conflicts_with("queue_name")
17111713
)
17121714
.arg(
17131715
Arg::new("ttl")
@@ -1864,6 +1866,12 @@ fn federation_subcommands() -> [Command; 5] {
18641866
.default_value("default")
18651867
.value_parser(value_parser!(FederationResourceCleanupMode))
18661868
)
1869+
.arg(
1870+
Arg::new("bind_nowait")
1871+
.long("bind-using-nowait")
1872+
.default_value("false")
1873+
.value_parser(value_parser!(bool))
1874+
)
18671875
.arg(
18681876
Arg::new("ttl")
18691877
.long("ttl")

src/commands.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,10 @@ pub fn declare_federation_upstream(
433433
.get_one::<FederationResourceCleanupMode>("resource_cleanup_mode")
434434
.cloned()
435435
.unwrap_or_default();
436+
let bind_using_nowait = command_args
437+
.get_one::<bool>("bind_nowait")
438+
.cloned()
439+
.unwrap_or_default();
436440
let ttl = command_args.get_one::<u32>("ttl").cloned();
437441
let message_ttl = command_args.get_one::<u32>("message_ttl").cloned();
438442
let efp = Some(ExchangeFederationParams {
@@ -453,7 +457,7 @@ pub fn declare_federation_upstream(
453457
trust_user_id,
454458
prefetch_count,
455459
ack_mode,
456-
bind_using_nowait: false,
460+
bind_using_nowait,
457461
queue_federation: qfp,
458462
exchange_federation: efp,
459463
};
@@ -497,6 +501,10 @@ pub fn declare_federation_upstream_for_exchange_federation(
497501
.get_one::<FederationResourceCleanupMode>("resource_cleanup_mode")
498502
.cloned()
499503
.unwrap_or_default();
504+
let bind_using_nowait = command_args
505+
.get_one::<bool>("bind_nowait")
506+
.cloned()
507+
.unwrap_or_default();
500508
let ttl = command_args.get_one::<u32>("ttl").cloned();
501509
let message_ttl = command_args.get_one::<u32>("message_ttl").cloned();
502510
let efp = Some(ExchangeFederationParams {
@@ -517,7 +525,7 @@ pub fn declare_federation_upstream_for_exchange_federation(
517525
trust_user_id,
518526
prefetch_count,
519527
ack_mode,
520-
bind_using_nowait: false,
528+
bind_using_nowait,
521529
queue_federation: None,
522530
exchange_federation: efp,
523531
};

0 commit comments

Comments
 (0)