Skip to content

Commit 6cf81e2

Browse files
committed
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
1 parent 60624e8 commit 6cf81e2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -101,7 +101,10 @@ void setJmsProperties(JmsProperties jmsProperties) {
101101
* Set the {@link ObservationRegistry} to use.
102102
* @param observationRegistry the {@link ObservationRegistry}
103103
* @since 3.2.1
104+
* @deprecated since 3.3.10 for removal in 3.6.0 as this should have been package
105+
* private
104106
*/
107+
@Deprecated(since = "3.3.10", forRemoval = true)
105108
public void setObservationRegistry(ObservationRegistry observationRegistry) {
106109
this.observationRegistry = observationRegistry;
107110
}

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,6 +72,7 @@ class JmsAnnotationDrivenConfiguration {
7272

7373
@Bean
7474
@ConditionalOnMissingBean
75+
@SuppressWarnings("removal")
7576
DefaultJmsListenerContainerFactoryConfigurer jmsListenerContainerFactoryConfigurer() {
7677
DefaultJmsListenerContainerFactoryConfigurer configurer = new DefaultJmsListenerContainerFactoryConfigurer();
7778
configurer.setDestinationResolver(this.destinationResolver.getIfUnique());

0 commit comments

Comments
 (0)