Skip to content

Commit ecb5e11

Browse files
garyrussellartembilan
authored andcommitted
Remove deprecated classes and methods
1 parent ff49223 commit ecb5e11

20 files changed

+12
-908
lines changed

spring-amqp/src/main/java/org/springframework/amqp/core/AmqpManagementOperations.java

Lines changed: 0 additions & 176 deletions
This file was deleted.

spring-amqp/src/main/java/org/springframework/amqp/core/AnonymousQueue.java

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@
1616

1717
package org.springframework.amqp.core;
1818

19-
import java.nio.ByteBuffer;
2019
import java.util.Map;
21-
import java.util.UUID;
22-
23-
import org.springframework.util.Assert;
24-
import org.springframework.util.Base64Utils;
2520

2621
/**
2722
* Represents an anonymous, non-durable, exclusive, auto-delete queue. The name has the
@@ -50,32 +45,6 @@ public AnonymousQueue(Map<String, Object> arguments) {
5045
this(org.springframework.amqp.core.Base64UrlNamingStrategy.DEFAULT, arguments);
5146
}
5247

53-
/**
54-
* Construct a queue with a name provided by the supplied naming strategy.
55-
* @param namingStrategy the naming strategy.
56-
* @deprecated in favor of {@link #AnonymousQueue(NamingStrategy)}.
57-
*
58-
* @since 1.5.3
59-
*/
60-
@Deprecated
61-
public AnonymousQueue(NamingStrategy namingStrategy) {
62-
this(namingStrategy, null);
63-
}
64-
65-
/**
66-
* Construct a queue with a name provided by the supplied naming strategy with the
67-
* supplied arguments.
68-
* @param namingStrategy the naming strategy.
69-
* @param arguments the arguments.
70-
* @deprecated in favor of {@link #AnonymousQueue(NamingStrategy, Map)}.
71-
*
72-
* @since 1.5.3
73-
*/
74-
@Deprecated
75-
public AnonymousQueue(NamingStrategy namingStrategy, Map<String, Object> arguments) {
76-
super(namingStrategy.generateName(), false, true, true, arguments);
77-
}
78-
7948
/**
8049
* Construct a queue with a name provided by the supplied naming strategy.
8150
* @param namingStrategy the naming strategy.
@@ -99,87 +68,4 @@ public AnonymousQueue(org.springframework.amqp.core.NamingStrategy namingStrateg
9968
}
10069
}
10170

102-
/**
103-
* A strategy to name anonymous queues.
104-
* @deprecated - use the {@link org.springframework.amqp.core.NamingStrategy}.
105-
* @since 1.5.3
106-
*
107-
*/
108-
@Deprecated
109-
@FunctionalInterface
110-
public interface NamingStrategy extends org.springframework.amqp.core.NamingStrategy {
111-
112-
}
113-
114-
/**
115-
* Generates names with the form {@code <prefix><base64url>} where
116-
* 'prefix' is 'spring.gen-' by default
117-
* (e.g. spring.gen-eIwaZAYgQv6LvwaDCfVTNQ);
118-
* the 'base64url' String is generated from a UUID. The base64 alphabet
119-
* is the "URL and Filename Safe Alphabet"; see RFC-4648. Trailing padding
120-
* characters (@code =) are removed.
121-
* @deprecated - use the {@link org.springframework.amqp.core.Base64UrlNamingStrategy}.
122-
* @since 1.5.3
123-
*/
124-
@Deprecated
125-
public static class Base64UrlNamingStrategy implements NamingStrategy {
126-
127-
/**
128-
* The default instance - using {@code spring.gen-} as the prefix.
129-
*/
130-
public static final Base64UrlNamingStrategy DEFAULT = new Base64UrlNamingStrategy();
131-
132-
private final String prefix;
133-
134-
/**
135-
* Construct an instance using the default prefix {@code spring.gen-}.
136-
*/
137-
public Base64UrlNamingStrategy() {
138-
this("spring.gen-");
139-
}
140-
141-
/**
142-
* Construct an instance using the supplied prefix.
143-
* @param prefix The prefix.
144-
*/
145-
public Base64UrlNamingStrategy(String prefix) {
146-
Assert.notNull(prefix, "'prefix' cannot be null; use an empty String ");
147-
this.prefix = prefix;
148-
}
149-
150-
@Override
151-
public String generateName() {
152-
UUID uuid = UUID.randomUUID();
153-
ByteBuffer bb = ByteBuffer.wrap(new byte[16]); // NOSONAR - Magic # deprecated anyway
154-
bb.putLong(uuid.getMostSignificantBits())
155-
.putLong(uuid.getLeastSignificantBits());
156-
// Convert to base64 and remove trailing =
157-
return this.prefix + Base64Utils.encodeToUrlSafeString(bb.array())
158-
.replaceAll("=", "");
159-
}
160-
161-
}
162-
163-
/**
164-
* Generates names using {@link UUID#randomUUID()}.
165-
* (e.g. "f20c818a-006b-4416-bf91-643590fedb0e").
166-
* @author Gary Russell
167-
* @deprecated - use the {@link org.springframework.amqp.core.UUIDNamingStrategy}.
168-
* @since 2.0
169-
*/
170-
@Deprecated
171-
public static class UUIDNamingStrategy implements NamingStrategy {
172-
173-
/**
174-
* The default instance.
175-
*/
176-
public static final UUIDNamingStrategy DEFAULT = new UUIDNamingStrategy();
177-
178-
@Override
179-
public String generateName() {
180-
return UUID.randomUUID().toString();
181-
}
182-
183-
}
184-
18571
}

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/AbstractRabbitListenerContainerFactory.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void setErrorHandler(ErrorHandler errorHandler) {
137137

138138
/**
139139
* @param messageConverter the message converter to use
140-
* @see AbstractMessageListenerContainer#setMessageConverter(MessageConverter)
140+
* @see RabbitListenerEndpoint#setMessageConverter(MessageConverter)
141141
*/
142142
public void setMessageConverter(MessageConverter messageConverter) {
143143
this.messageConverter = messageConverter;
@@ -344,7 +344,6 @@ public void setContainerConfigurer(Consumer<C> configurer) {
344344
this.containerConfigurer = configurer;
345345
}
346346

347-
@SuppressWarnings("deprecation")
348347
@Override
349348
public C createListenerContainer(RabbitListenerEndpoint endpoint) {
350349
C instance = createContainerInstance();
@@ -354,12 +353,6 @@ public C createListenerContainer(RabbitListenerEndpoint endpoint) {
354353
if (this.messageConverter != null) {
355354
if (endpoint != null) {
356355
endpoint.setMessageConverter(this.messageConverter);
357-
if (endpoint.getMessageConverter() == null) {
358-
instance.setMessageConverter(this.messageConverter);
359-
}
360-
}
361-
else {
362-
instance.setMessageConverter(this.messageConverter);
363356
}
364357
}
365358
javaUtils

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/ListenerContainerFactoryBean.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -221,25 +221,6 @@ public void setErrorHandler(ErrorHandler errorHandler) {
221221
this.errorHandler = errorHandler;
222222
}
223223

224-
/*
225-
* Unlikely this FB is used for a RabbitListener (it's only used by the
226-
* XML parser and this property is never set). We could probably just
227-
* remove this, but deprecating, just in case.
228-
*/
229-
/**
230-
* Set the {@link MessageConverter} strategy for converting AMQP Messages.
231-
* @param messageConverter the message converter to use
232-
* @deprecated - this converter is not used by the container; it was only
233-
* used to configure the converter for a {@code @RabbitListener} adapter.
234-
* That is now handled differently. If you are manually creating a listener
235-
* container, the converter must be configured in a listener adapter (if
236-
* present).
237-
*/
238-
@Deprecated
239-
public void setMessageConverter(MessageConverter messageConverter) {
240-
this.messageConverter = messageConverter;
241-
}
242-
243224
public void setDeBatchingEnabled(boolean deBatchingEnabled) {
244225
this.deBatchingEnabled = deBatchingEnabled;
245226
}
@@ -421,7 +402,6 @@ protected AbstractMessageListenerContainer createInstance() { // NOSONAR complex
421402
.acceptIfNotNull(this.exposeListenerChannel, container::setExposeListenerChannel)
422403
.acceptIfNotNull(this.messageListener, container::setMessageListener)
423404
.acceptIfNotNull(this.errorHandler, container::setErrorHandler)
424-
.acceptIfNotNull(this.messageConverter, container::setMessageConverter)
425405
.acceptIfNotNull(this.deBatchingEnabled, container::setDeBatchingEnabled)
426406
.acceptIfNotNull(this.adviceChain, container::setAdviceChain)
427407
.acceptIfNotNull(this.afterReceivePostProcessors, container::setAfterReceivePostProcessors)

0 commit comments

Comments
 (0)