From f9e4dbf9a6a6e7cdf64eca8c17f76e2c4da9d223 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Fri, 20 Oct 2023 15:51:25 -0400 Subject: [PATCH] feedback and fix tests --- src/sources/nats.rs | 17 +++++++++++++++-- .../reference/components/sources/base/nats.cue | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/sources/nats.rs b/src/sources/nats.rs index 645c7bcefd808..f3023849ef562 100644 --- a/src/sources/nats.rs +++ b/src/sources/nats.rs @@ -100,7 +100,7 @@ pub struct NatsSourceConfig { /// The buffer capacity of the underlying NATS subscriber. /// - /// This value determines how many messages the NATS subscriber will buffer + /// This value determines how many messages the NATS subscriber buffers /// before incoming messages are dropped. /// /// See the [async_nats documentation][async_nats_subscription_capacity] for more information. @@ -115,7 +115,7 @@ fn default_subject_key_field() -> OptionalValuePath { OptionalValuePath::from(owned_value_path!("subject")) } -fn default_subscription_capacity() -> usize { +const fn default_subscription_capacity() -> usize { 4096 } @@ -432,6 +432,7 @@ mod integration_tests { auth: None, log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -464,6 +465,7 @@ mod integration_tests { }), log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -496,6 +498,7 @@ mod integration_tests { }), log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -527,6 +530,7 @@ mod integration_tests { }), log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -558,6 +562,7 @@ mod integration_tests { }), log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -590,6 +595,7 @@ mod integration_tests { }), log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -622,6 +628,7 @@ mod integration_tests { }), log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -655,6 +662,7 @@ mod integration_tests { auth: None, log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -682,6 +690,7 @@ mod integration_tests { auth: None, log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -717,6 +726,7 @@ mod integration_tests { auth: None, log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -750,6 +760,7 @@ mod integration_tests { auth: None, log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -787,6 +798,7 @@ mod integration_tests { }), log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; @@ -824,6 +836,7 @@ mod integration_tests { }), log_namespace: None, subject_key_field: default_subject_key_field(), + ..Default::default() }; let r = publish_and_check(conf).await; diff --git a/website/cue/reference/components/sources/base/nats.cue b/website/cue/reference/components/sources/base/nats.cue index c2c8013a7f130..21d814c94df9f 100644 --- a/website/cue/reference/components/sources/base/nats.cue +++ b/website/cue/reference/components/sources/base/nats.cue @@ -349,7 +349,7 @@ base: components: sources: nats: configuration: { description: """ The buffer capacity of the underlying NATS subscriber. - This value determines how many messages the NATS subscriber will buffer + This value determines how many messages the NATS subscriber buffers before incoming messages are dropped. See the [async_nats documentation][async_nats_subscription_capacity] for more information.