mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Unify 'observation-enabled' property defaults
Change spring.pulsar.listener.observation-enabled and spring.pulsar.template.observations-enabled to false See gh-39276
This commit is contained in:
parent
50cae75cb7
commit
f5c9d34a5d
@ -761,7 +761,7 @@ public class PulsarProperties {
|
|||||||
* Whether to record observations for when the Observations API is available and
|
* Whether to record observations for when the Observations API is available and
|
||||||
* the client supports it.
|
* the client supports it.
|
||||||
*/
|
*/
|
||||||
private boolean observationEnabled = true;
|
private boolean observationEnabled;
|
||||||
|
|
||||||
public SchemaType getSchemaType() {
|
public SchemaType getSchemaType() {
|
||||||
return this.schemaType;
|
return this.schemaType;
|
||||||
@ -856,7 +856,7 @@ public class PulsarProperties {
|
|||||||
/**
|
/**
|
||||||
* Whether to record observations for when the Observations API is available.
|
* Whether to record observations for when the Observations API is available.
|
||||||
*/
|
*/
|
||||||
private boolean observationsEnabled = true;
|
private boolean observationsEnabled;
|
||||||
|
|
||||||
public boolean isObservationsEnabled() {
|
public boolean isObservationsEnabled() {
|
||||||
return this.observationsEnabled;
|
return this.observationsEnabled;
|
||||||
|
@ -304,7 +304,7 @@ class PulsarAutoConfigurationTests {
|
|||||||
@Test
|
@Test
|
||||||
void whenNoPropertiesEnablesObservation() {
|
void whenNoPropertiesEnablesObservation() {
|
||||||
this.contextRunner.run((context) -> assertThat(context).getBean(PulsarTemplate.class)
|
this.contextRunner.run((context) -> assertThat(context).getBean(PulsarTemplate.class)
|
||||||
.hasFieldOrPropertyWithValue("observationEnabled", true));
|
.hasFieldOrPropertyWithValue("observationEnabled", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -451,7 +451,7 @@ class PulsarAutoConfigurationTests {
|
|||||||
void whenNoPropertiesEnablesObservation() {
|
void whenNoPropertiesEnablesObservation() {
|
||||||
this.contextRunner
|
this.contextRunner
|
||||||
.run((context) -> assertThat(context).getBean(ConcurrentPulsarListenerContainerFactory.class)
|
.run((context) -> assertThat(context).getBean(ConcurrentPulsarListenerContainerFactory.class)
|
||||||
.hasFieldOrPropertyWithValue("containerProperties.observationEnabled", true));
|
.hasFieldOrPropertyWithValue("containerProperties.observationEnabled", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -219,12 +219,12 @@ class PulsarPropertiesMapperTests {
|
|||||||
PulsarProperties properties = new PulsarProperties();
|
PulsarProperties properties = new PulsarProperties();
|
||||||
properties.getConsumer().getSubscription().setType(SubscriptionType.Shared);
|
properties.getConsumer().getSubscription().setType(SubscriptionType.Shared);
|
||||||
properties.getListener().setSchemaType(SchemaType.AVRO);
|
properties.getListener().setSchemaType(SchemaType.AVRO);
|
||||||
properties.getListener().setObservationEnabled(false);
|
properties.getListener().setObservationEnabled(true);
|
||||||
PulsarContainerProperties containerProperties = new PulsarContainerProperties("my-topic-pattern");
|
PulsarContainerProperties containerProperties = new PulsarContainerProperties("my-topic-pattern");
|
||||||
new PulsarPropertiesMapper(properties).customizeContainerProperties(containerProperties);
|
new PulsarPropertiesMapper(properties).customizeContainerProperties(containerProperties);
|
||||||
assertThat(containerProperties.getSubscriptionType()).isEqualTo(SubscriptionType.Shared);
|
assertThat(containerProperties.getSubscriptionType()).isEqualTo(SubscriptionType.Shared);
|
||||||
assertThat(containerProperties.getSchemaType()).isEqualTo(SchemaType.AVRO);
|
assertThat(containerProperties.getSchemaType()).isEqualTo(SchemaType.AVRO);
|
||||||
assertThat(containerProperties.isObservationEnabled()).isFalse();
|
assertThat(containerProperties.isObservationEnabled()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -354,10 +354,10 @@ class PulsarPropertiesTests {
|
|||||||
void bind() {
|
void bind() {
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
map.put("spring.pulsar.listener.schema-type", "avro");
|
map.put("spring.pulsar.listener.schema-type", "avro");
|
||||||
map.put("spring.pulsar.listener.observation-enabled", "false");
|
map.put("spring.pulsar.listener.observation-enabled", "true");
|
||||||
PulsarProperties.Listener properties = bindPropeties(map).getListener();
|
PulsarProperties.Listener properties = bindPropeties(map).getListener();
|
||||||
assertThat(properties.getSchemaType()).isEqualTo(SchemaType.AVRO);
|
assertThat(properties.getSchemaType()).isEqualTo(SchemaType.AVRO);
|
||||||
assertThat(properties.isObservationEnabled()).isFalse();
|
assertThat(properties.isObservationEnabled()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -389,9 +389,9 @@ class PulsarPropertiesTests {
|
|||||||
@Test
|
@Test
|
||||||
void bind() {
|
void bind() {
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
map.put("spring.pulsar.template.observations-enabled", "false");
|
map.put("spring.pulsar.template.observations-enabled", "true");
|
||||||
PulsarProperties.Template properties = bindPropeties(map).getTemplate();
|
PulsarProperties.Template properties = bindPropeties(map).getTemplate();
|
||||||
assertThat(properties.isObservationsEnabled()).isFalse();
|
assertThat(properties.isObservationsEnabled()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user