From 0ee4b41b2f7f4fd39736c9ef986b1219aa07a48c Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Fri, 7 Jan 2022 16:13:22 -0500 Subject: [PATCH] Remove StreamMessageConverter StreamMessageConverter was deprecated in 3.0.x and now removed completely in 4.0.x. --- .../config/CustomMessageConverterTests.java | 5 -- .../annotation/StreamMessageConverter.java | 46 ------------------- 2 files changed, 51 deletions(-) delete mode 100644 spring-cloud-stream/src/main/java/org/springframework/cloud/stream/annotation/StreamMessageConverter.java diff --git a/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/config/CustomMessageConverterTests.java b/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/config/CustomMessageConverterTests.java index 515e4ebe1..5a6485eed 100644 --- a/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/config/CustomMessageConverterTests.java +++ b/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/config/CustomMessageConverterTests.java @@ -26,7 +26,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.stream.annotation.EnableBinding; -import org.springframework.cloud.stream.annotation.StreamMessageConverter; import org.springframework.cloud.stream.binder.BinderFactory; import org.springframework.cloud.stream.messaging.Source; import org.springframework.cloud.stream.test.binder.TestSupportBinder; @@ -59,12 +58,10 @@ public class CustomMessageConverterTests { private BinderFactory binderFactory; @Autowired - @StreamMessageConverter private List customMessageConverters; @Test public void testCustomMessageConverter() throws Exception { - assertThat(this.customMessageConverters).hasSize(2); assertThat(this.customMessageConverters).extracting("class") .contains(FooConverter.class, BarConverter.class); this.testSource.output().send(MessageBuilder.withPayload(new Foo("hi")).build()); @@ -84,13 +81,11 @@ public class CustomMessageConverterTests { public static class TestSource { @Bean - @StreamMessageConverter public MessageConverter fooConverter() { return new FooConverter(); } @Bean - @StreamMessageConverter public MessageConverter barConverter() { return new BarConverter(); } diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/annotation/StreamMessageConverter.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/annotation/StreamMessageConverter.java deleted file mode 100644 index 443bc9fe9..000000000 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/annotation/StreamMessageConverter.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2017-2019 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.stream.annotation; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.context.annotation.Bean; - -/** - * Marker to tag {@link org.springframework.messaging.converter.MessageConverter} beans - * that will be added to the - * {@link org.springframework.cloud.stream.converter.CompositeMessageConverterFactory}. - * - * @author Vinicius Carvalho - * @author Arten Bilan - * - * @deprecated as of 3.0 and is not used by the framework anymore. - */ -@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER }) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Qualifier -@Bean -@Deprecated -public @interface StreamMessageConverter { - -}