Browse Source

Deprecate setObservationRegistry

This commit deprecates setObservationRegistry on
DefaultJmsListenerContainerFactoryConfigurer as it should not have been
made public in the first place. We want to make sure users don't
accidentally use it, and move it back to a package private method once
the deprecation period has run its course.

Closes gh-44466
pull/42891/head
Stéphane Nicoll 1 year ago
parent
commit
6cf81e2f1b
  1. 5
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java
  2. 3
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java

5
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -101,7 +101,10 @@ public final class DefaultJmsListenerContainerFactoryConfigurer { @@ -101,7 +101,10 @@ public final class DefaultJmsListenerContainerFactoryConfigurer {
* Set the {@link ObservationRegistry} to use.
* @param observationRegistry the {@link ObservationRegistry}
* @since 3.2.1
* @deprecated since 3.3.10 for removal in 3.6.0 as this should have been package
* private
*/
@Deprecated(since = "3.3.10", forRemoval = true)
public void setObservationRegistry(ObservationRegistry observationRegistry) {
this.observationRegistry = observationRegistry;
}

3
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -72,6 +72,7 @@ class JmsAnnotationDrivenConfiguration { @@ -72,6 +72,7 @@ class JmsAnnotationDrivenConfiguration {
@Bean
@ConditionalOnMissingBean
@SuppressWarnings("removal")
DefaultJmsListenerContainerFactoryConfigurer jmsListenerContainerFactoryConfigurer() {
DefaultJmsListenerContainerFactoryConfigurer configurer = new DefaultJmsListenerContainerFactoryConfigurer();
configurer.setDestinationResolver(this.destinationResolver.getIfUnique());

Loading…
Cancel
Save