From 6cf81e2f1be4e7973dff67a01f77d27ff22943a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Thu, 6 Mar 2025 08:45:49 +0100 Subject: [PATCH] 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 --- .../jms/DefaultJmsListenerContainerFactoryConfigurer.java | 5 ++++- .../autoconfigure/jms/JmsAnnotationDrivenConfiguration.java | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java index 66ab3db1ee6..91f6e87f3a3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java @@ -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 { * 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; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java index 50886368340..689912241a3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java @@ -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 { @Bean @ConditionalOnMissingBean + @SuppressWarnings("removal") DefaultJmsListenerContainerFactoryConfigurer jmsListenerContainerFactoryConfigurer() { DefaultJmsListenerContainerFactoryConfigurer configurer = new DefaultJmsListenerContainerFactoryConfigurer(); configurer.setDestinationResolver(this.destinationResolver.getIfUnique());