Skip to content

Commit

Permalink
fix: remove redundant consumer_durable_name (#19090)
Browse files Browse the repository at this point in the history
Co-authored-by: tabversion <[email protected]>
  • Loading branch information
tabVersion and tabversion authored Oct 24, 2024
1 parent e6f830b commit bdfd892
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
13 changes: 2 additions & 11 deletions src/connector/src/source/nats/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -121,9 +121,6 @@ pub struct NatsPropertiesConsumer {
#[serde(rename = "consumer.deliver_subject")]
pub deliver_subject: Option<String>,

#[serde(rename = "consumer.durable_name")]
pub durable_name: Option<String>,

#[serde(rename = "consumer.name")]
pub name: Option<String>,

Expand Down Expand Up @@ -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())
}
Expand Down Expand Up @@ -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())
Expand Down
5 changes: 1 addition & 4 deletions src/connector/with_options_source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit bdfd892

Please sign in to comment.