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
This commit is contained in:
Stéphane Nicoll
2025-03-06 08:45:49 +01:00
parent 60624e8a56
commit 6cf81e2f1b
2 changed files with 6 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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());