Skip to content

Commit 6f9809e

Browse files
committed
Fix depreactions
1 parent 9aabfbe commit 6f9809e

File tree

17 files changed

+5
-353
lines changed

17 files changed

+5
-353
lines changed

binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaConsumerProperties.java

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,13 @@ public enum StandardHeaders {
8686

8787
}
8888

89-
/**
90-
* When true the offset is committed after each record, otherwise the offsets for the complete set of records
91-
* received from the poll() are committed after all records have been processed.
92-
*/
93-
@Deprecated
94-
private boolean ackEachRecord;
9589

9690
/**
9791
* When true, topic partitions is automatically rebalanced between the members of a consumer group.
9892
* When false, each consumer is assigned a fixed set of partitions based on spring.cloud.stream.instanceCount and spring.cloud.stream.instanceIndex.
9993
*/
10094
private boolean autoRebalanceEnabled = true;
10195

102-
/**
103-
* Whether to autocommit offsets when a message has been processed.
104-
* If set to false, a header with the key kafka_acknowledgment of the type org.springframework.kafka.support.Acknowledgment header
105-
* is present in the inbound message. Applications may use this header for acknowledging messages.
106-
*/
107-
@Deprecated
108-
private boolean autoCommitOffset = true;
109-
11096
/**
11197
* Controlling the container acknowledgement mode. This is the preferred way to control the ack mode on the
11298
* container instead of the deprecated autoCommitOffset property.
@@ -152,12 +138,6 @@ public enum StandardHeaders {
152138
*/
153139
private KafkaProducerProperties dlqProducerProperties = new KafkaProducerProperties();
154140

155-
/**
156-
* @deprecated No longer used by the binder.
157-
*/
158-
@Deprecated
159-
private int recoveryInterval = 5000;
160-
161141
/**
162142
* List of trusted packages to provide the header mapper.
163143
*/
@@ -230,53 +210,6 @@ public enum StandardHeaders {
230210
*/
231211
private boolean reactiveAtMostOnce;
232212

233-
/**
234-
* @return if each record needs to be acknowledged.
235-
*
236-
* When true the offset is committed after each record, otherwise the offsets for the complete set of records
237-
* received from the poll() are committed after all records have been processed.
238-
*
239-
* @deprecated since 3.1 in favor of using {@link #ackMode}
240-
*/
241-
@Deprecated
242-
public boolean isAckEachRecord() {
243-
return this.ackEachRecord;
244-
}
245-
246-
/**
247-
* @param ackEachRecord
248-
*
249-
* @deprecated in favor of using {@link #ackMode}
250-
*/
251-
@Deprecated
252-
public void setAckEachRecord(boolean ackEachRecord) {
253-
this.ackEachRecord = ackEachRecord;
254-
}
255-
256-
/**
257-
* @return is autocommit offset enabled
258-
*
259-
* Whether to autocommit offsets when a message has been processed.
260-
* If set to false, a header with the key kafka_acknowledgment of the type org.springframework.kafka.support.Acknowledgment header
261-
* is present in the inbound message. Applications may use this header for acknowledging messages.
262-
*
263-
* @deprecated since 3.1 in favor of using {@link #ackMode}
264-
*/
265-
@Deprecated
266-
public boolean isAutoCommitOffset() {
267-
return this.autoCommitOffset;
268-
}
269-
270-
/**
271-
* @param autoCommitOffset
272-
*
273-
* @deprecated in favor of using {@link #ackMode}
274-
*/
275-
@Deprecated
276-
public void setAutoCommitOffset(boolean autoCommitOffset) {
277-
this.autoCommitOffset = autoCommitOffset;
278-
}
279-
280213
/**
281214
* @return Container's ack mode.
282215
*/
@@ -348,26 +281,6 @@ public void setAutoCommitOnError(Boolean autoCommitOnError) {
348281
this.autoCommitOnError = autoCommitOnError;
349282
}
350283

351-
/**
352-
* No longer used.
353-
* @return the interval.
354-
* @deprecated No longer used by the binder
355-
*/
356-
@Deprecated
357-
public int getRecoveryInterval() {
358-
return this.recoveryInterval;
359-
}
360-
361-
/**
362-
* No longer used.
363-
* @param recoveryInterval the interval.
364-
* @deprecated No longer needed by the binder
365-
*/
366-
@Deprecated
367-
public void setRecoveryInterval(int recoveryInterval) {
368-
this.recoveryInterval = recoveryInterval;
369-
}
370-
371284
/**
372285
* @return is auto rebalance enabled
373286
*

binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/java/org/springframework/cloud/stream/binder/kafka/KafkaMessageChannelBinder.java

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -321,18 +321,6 @@ public void setProducerListener(ProducerListener<byte[], byte[]> producerListene
321321
this.producerListener = producerListener;
322322
}
323323

324-
/**
325-
* Set a {@link ClientFactoryCustomizer} for the {@link ProducerFactory} and {@link ConsumerFactory} created inside
326-
* the binder.
327-
*
328-
* @param customizer the client factory customizer
329-
* @deprecated in favor of {@link #addClientFactoryCustomizer(ClientFactoryCustomizer)}.
330-
*/
331-
@Deprecated
332-
public void setClientFactoryCustomizer(ClientFactoryCustomizer customizer) {
333-
addClientFactoryCustomizer(customizer);
334-
}
335-
336324
public void addClientFactoryCustomizer(ClientFactoryCustomizer customizer) {
337325
if (customizer != null) {
338326
this.clientFactoryCustomizers.add(customizer);
@@ -686,17 +674,7 @@ else if (applicationContext != null) {
686674
messageListenerContainer.setBeanName(destination + ".container");
687675
// end of these won't be needed...
688676
ContainerProperties.AckMode ackMode = extendedConsumerProperties.getExtension().getAckMode();
689-
if (ackMode == null) {
690-
if (extendedConsumerProperties.getExtension().isAckEachRecord()) {
691-
ackMode = ContainerProperties.AckMode.RECORD;
692-
}
693-
else {
694-
if (!extendedConsumerProperties.getExtension().isAutoCommitOffset()) {
695-
messageListenerContainer.getContainerProperties()
696-
.setAckMode(ContainerProperties.AckMode.MANUAL);
697-
}
698-
}
699-
}
677+
700678
if (ackMode != null) {
701679
if ((extendedConsumerProperties.isBatchMode() && ackMode != ContainerProperties.AckMode.RECORD) ||
702680
!extendedConsumerProperties.isBatchMode()) {
@@ -1425,32 +1403,12 @@ private String getStackTraceAsString(Throwable cause) {
14251403
return stringWriter.getBuffer().toString();
14261404
}
14271405

1428-
/**
1429-
* Set a {@link ConsumerConfigCustomizer} for the {@link ConsumerFactory} created inside the binder.
1430-
* @param consumerConfigCustomizer the consumer config customizer
1431-
* @deprecated in favor of {@link #addConsumerConfigCustomizer(ConsumerConfigCustomizer)}.
1432-
*/
1433-
@Deprecated
1434-
public void setConsumerConfigCustomizer(ConsumerConfigCustomizer consumerConfigCustomizer) {
1435-
addConsumerConfigCustomizer(consumerConfigCustomizer);
1436-
}
1437-
14381406
public void addConsumerConfigCustomizer(ConsumerConfigCustomizer consumerConfigCustomizer) {
14391407
if (consumerConfigCustomizer != null) {
14401408
this.consumerConfigCustomizers.add(consumerConfigCustomizer);
14411409
}
14421410
}
14431411

1444-
/**
1445-
* Set a {@link ProducerConfigCustomizer} for the {@link ProducerFactory} created inside the binder.
1446-
* @param producerConfigCustomizer the producer config customizer
1447-
* @deprecated in favor of {@link #addProducerConfigCustomizer(ProducerConfigCustomizer)}.
1448-
*/
1449-
@Deprecated
1450-
public void setProducerConfigCustomizer(ProducerConfigCustomizer producerConfigCustomizer) {
1451-
addProducerConfigCustomizer(producerConfigCustomizer);
1452-
}
1453-
14541412
public void addProducerConfigCustomizer(ProducerConfigCustomizer producerConfigCustomizer) {
14551413
if (producerConfigCustomizer != null) {
14561414
this.producerConfigCustomizers.add(producerConfigCustomizer);

binders/kafka-binder/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/KafkaBinderTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,6 @@ void autoCommitOnErrorWhenManualAcknowledgement() throws Exception {
15151515
consumerProperties.setBackOffMaxInterval(150);
15161516
//When auto commit is disabled, then the record is committed after publishing to DLQ using the manual acknowledgement.
15171517
// (if DLQ is enabled, which is, in this case).
1518-
consumerProperties.getExtension().setAutoCommitOffset(false);
15191518
consumerProperties.getExtension().setEnableDlq(true);
15201519

15211520
DirectChannel moduleInputChannel = createBindableChannel("input",

binders/kafka-binder/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/integration/KafkaBinderExtendedPropertiesTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ void kafkaBinderExtendedProperties() throws Exception {
136136
customKafkaConsumerProperties.getConfiguration().get("value.serializer"))
137137
.isEqualTo("BarSerializer.class");
138138

139-
assertThat(kafkaConsumerProperties.isAckEachRecord()).isEqualTo(true);
140-
assertThat(customKafkaConsumerProperties.isAckEachRecord()).isEqualTo(false);
141-
142139
RebalanceListener rebalanceListener = context.getBean(RebalanceListener.class);
143140
assertThat(rebalanceListener.latch.await(10, TimeUnit.SECONDS)).isTrue();
144141
assertThat(rebalanceListener.bindings.keySet()).contains("standard-in",

binders/rabbit-binder/spring-cloud-stream-binder-rabbit-core/src/main/java/org/springframework/cloud/stream/binder/rabbit/properties/RabbitBinderConfigurationProperties.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,6 @@ public void setAdminAddresses(String[] adminAddresses) {
5454
this.adminAddresses = adminAddresses;
5555
}
5656

57-
/**
58-
* @param adminAddresses A comma-separated list of RabbitMQ management plugin URLs.
59-
* @deprecated in favor of {@link #setAdminAddresses(String[])}. Will be removed in a
60-
* future release.
61-
*/
62-
@Deprecated
63-
public void setAdminAdresses(String[] adminAddresses) {
64-
setAdminAddresses(adminAddresses);
65-
}
66-
67-
@Deprecated
68-
public String[] getAdminAdresses() {
69-
return this.adminAddresses;
70-
}
71-
7257
public String[] getNodes() {
7358
return nodes;
7459
}

binders/rabbit-binder/spring-cloud-stream-binder-rabbit-core/src/main/java/org/springframework/cloud/stream/binder/rabbit/properties/RabbitConsumerProperties.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -180,42 +180,6 @@ public void setPrefetch(int prefetch) {
180180
this.prefetch = prefetch;
181181
}
182182

183-
/**
184-
* @return the header patterns.
185-
* @deprecated - use {@link #getHeaderPatterns()}.
186-
*/
187-
@Deprecated
188-
public String[] getRequestHeaderPatterns() {
189-
return this.headerPatterns;
190-
}
191-
192-
/**
193-
* @param requestHeaderPatterns request header patterns
194-
* @deprecated - use {@link #setHeaderPatterns(String[])}.
195-
*/
196-
@Deprecated
197-
public void setRequestHeaderPatterns(String[] requestHeaderPatterns) {
198-
this.headerPatterns = requestHeaderPatterns;
199-
}
200-
201-
/**
202-
* @return the tx size.
203-
* @deprecated in favor of {@link #getBatchSize()}
204-
*/
205-
@Deprecated
206-
@Min(value = 1, message = "Tx Size should be greater than zero.")
207-
public int getTxSize() {
208-
return getBatchSize();
209-
}
210-
211-
/**
212-
* @param txSize the tx size
213-
* deprecated in favor of {@link #setBatchSize(int)}.
214-
*/
215-
public void setTxSize(int txSize) {
216-
setBatchSize(txSize);
217-
}
218-
219183
@Min(value = 1, message = "Batch Size should be greater than zero.")
220184
public int getBatchSize() {
221185
return batchSize;

binders/rabbit-binder/spring-cloud-stream-binder-rabbit-core/src/main/java/org/springframework/cloud/stream/binder/rabbit/properties/RabbitProducerProperties.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -163,24 +163,6 @@ public enum ProducerType {
163163
*/
164164
private boolean superStream;
165165

166-
/**
167-
* @param requestHeaderPatterns the patterns.
168-
* @deprecated - use {@link #setHeaderPatterns(String[])}.
169-
*/
170-
@Deprecated
171-
public void setRequestHeaderPatterns(String[] requestHeaderPatterns) {
172-
this.headerPatterns = requestHeaderPatterns;
173-
}
174-
175-
/**
176-
* @return the header patterns.
177-
* @deprecated - use {@link #getHeaderPatterns()}.
178-
*/
179-
@Deprecated
180-
public String[] getRequestHeaderPatterns() {
181-
return this.headerPatterns;
182-
}
183-
184166
public void setCompress(boolean compress) {
185167
this.compress = compress;
186168
}

binders/rabbit-binder/spring-cloud-stream-binder-rabbit/src/test/java/org/springframework/cloud/stream/binder/rabbit/RabbitBinderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ void consumerProperties() throws Exception {
499499
properties.getExtension().setPrefix("foo.");
500500
properties.getExtension().setPrefetch(20);
501501
properties.getExtension().setHeaderPatterns(new String[] { "foo" });
502-
properties.getExtension().setTxSize(10);
502+
properties.getExtension().setBatchSize(10);
503503
QuorumConfig quorum = properties.getExtension().getQuorum();
504504
quorum.setEnabled(true);
505505
quorum.setDeliveryLimit(10);

core/spring-cloud-stream-test-binder/src/main/java/org/springframework/cloud/stream/binder/test/InputDestination.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@ public void send(Message<?> message) {
3737
this.getChannel(0).send(message);
3838
}
3939

40-
/**
41-
* @param message message to send
42-
* @param inputIndex input index
43-
* @deprecated since 3.0.2 in favor of {@link #receive(long, String)} where you should use the actual binding name (e.g., "foo-in-0")
44-
*/
45-
@Deprecated
46-
public void send(Message<?> message, int inputIndex) {
47-
this.getChannel(inputIndex).send(message);
48-
}
49-
5040
/**
5141
* Allows the {@link Message} to be sent to a Binder's destination.<br>
5242
* This needs a bit of clarification. Just like with any binder, 'destination'

core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/PartitionHandler.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,6 @@ public class PartitionHandler {
5656

5757
private volatile int partitionCount;
5858

59-
/**
60-
* Construct a {@code PartitionHandler}.
61-
* @param evaluationContext evaluation context for binder
62-
* @param properties binder properties
63-
* @param partitionKeyExtractorStrategy PartitionKeyExtractor strategy
64-
* @param partitionSelectorStrategy PartitionSelector strategy
65-
*
66-
* @deprecated since 3.0.2. Please use another constructor which allows you to pass an instance of beanFactory
67-
*/
68-
@Deprecated
69-
public PartitionHandler(EvaluationContext evaluationContext,
70-
ProducerProperties properties,
71-
PartitionKeyExtractorStrategy partitionKeyExtractorStrategy,
72-
PartitionSelectorStrategy partitionSelectorStrategy) {
73-
74-
this(evaluationContext, properties, (ConfigurableListableBeanFactory) extractBeanFactoryFromEvaluationContext(evaluationContext));
75-
}
76-
7759
/**
7860
* Construct a {@code PartitionHandler}.
7961
* @param evaluationContext evaluation context for binder

0 commit comments

Comments
 (0)