From ee62d18b036e75d9f794cc0585ab98c8f1d485f4 Mon Sep 17 00:00:00 2001 From: tabversion Date: Thu, 24 Oct 2024 12:26:27 +0800 Subject: [PATCH] fix --- src/connector/src/source/nats/mod.rs | 13 ++----------- src/connector/with_options_source.yaml | 5 +---- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/connector/src/source/nats/mod.rs b/src/connector/src/source/nats/mod.rs index b8a3b7948aee2..273eac41846ce 100644 --- a/src/connector/src/source/nats/mod.rs +++ b/src/connector/src/source/nats/mod.rs @@ -100,7 +100,7 @@ pub struct NatsProperties { #[serde(rename = "stream")] pub stream: String, - #[serde(rename = "durable_consumer_name")] + #[serde(rename = "consumer.durable_name")] pub durable_consumer_name: String, #[serde(flatten)] @@ -121,9 +121,6 @@ pub struct NatsPropertiesConsumer { #[serde(rename = "consumer.deliver_subject")] pub deliver_subject: Option, - #[serde(rename = "consumer.durable_name")] - pub durable_name: Option, - #[serde(rename = "consumer.name")] pub name: Option, @@ -217,9 +214,6 @@ impl NatsPropertiesConsumer { if let Some(v) = &self.name { c.name = Some(v.clone()) } - if let Some(v) = &self.durable_name { - c.durable_name = Some(v.clone()) - } if let Some(v) = &self.description { c.description = Some(v.clone()) } @@ -353,10 +347,7 @@ mod test { props.nats_properties_consumer.name, Some("foobar".to_string()) ); - assert_eq!( - props.nats_properties_consumer.durable_name, - Some("durable_foobar".to_string()) - ); + assert_eq!(props.durable_consumer_name, "durable_foobar".to_string()); assert_eq!( props.nats_properties_consumer.description, Some("A description".to_string()) diff --git a/src/connector/with_options_source.yaml b/src/connector/with_options_source.yaml index 20d3fc1714233..c4d9604a8f053 100644 --- a/src/connector/with_options_source.yaml +++ b/src/connector/with_options_source.yaml @@ -562,9 +562,6 @@ NatsProperties: - name: consumer.deliver_subject field_type: String required: false - - name: consumer.durable_name - field_type: String - required: false - name: consumer.name field_type: String required: false @@ -643,7 +640,7 @@ NatsProperties: - name: stream field_type: String required: true - - name: durable_consumer_name + - name: consumer.durable_name field_type: String required: true NexmarkProperties: