diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/bindings/BindingFactory.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/bindings/BindingFactory.java index 2d75c2b92..3a86cbbfc 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/bindings/BindingFactory.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/bindings/BindingFactory.java @@ -11,19 +11,22 @@ import java.util.Map; public interface BindingFactory { - @Deprecated // maintainer note: replaced by #getChannelId(T, BindingContext) + + // maintainer note: replaced by #getChannelId(T, BindingContext) default String getChannelId(T annotation) { return ReferenceUtil.toValidId(getChannelName(annotation)); } - @Deprecated // maintainer note: replaced by #getChannelName(T, BindingContext) + // maintainer note: replaced by #getChannelName(T, BindingContext) String getChannelName(T annotation); default String getChannelId(T annotation, BindingContext bindingContext) { - return ReferenceUtil.toValidId(getChannelName(annotation, bindingContext)); + return getChannelId(annotation); } - String getChannelName(T annotation, BindingContext bindingContext); + default String getChannelName(T annotation, BindingContext bindingContext) { + return getChannelName(annotation); + } Map buildChannelBinding(T annotation); diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/channels/annotations/SpringAnnotationClassLevelChannelsScannerIntegrationTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/channels/annotations/SpringAnnotationClassLevelChannelsScannerIntegrationTest.java index e5f093f0a..6bbbd7955 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/channels/annotations/SpringAnnotationClassLevelChannelsScannerIntegrationTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/channels/annotations/SpringAnnotationClassLevelChannelsScannerIntegrationTest.java @@ -19,7 +19,6 @@ import io.github.springwolf.core.asyncapi.components.examples.walkers.DefaultSchemaWalker; import io.github.springwolf.core.asyncapi.components.examples.walkers.json.ExampleJsonValueGenerator; import io.github.springwolf.core.asyncapi.scanners.bindings.BindingFactory; -import io.github.springwolf.core.asyncapi.scanners.bindings.common.BindingContext; import io.github.springwolf.core.asyncapi.scanners.common.channel.SpringAnnotationChannelService; import io.github.springwolf.core.asyncapi.scanners.common.headers.AsyncHeadersNotDocumented; import io.github.springwolf.core.asyncapi.scanners.common.headers.HeaderClassExtractor; @@ -296,11 +295,6 @@ public String getChannelName(TestClassListener annotation) { return CHANNEL; } - @Override - public String getChannelName(TestClassListener annotation, BindingContext bindingContext) { - return CHANNEL; - } - @Override public Map buildChannelBinding(TestClassListener annotation) { return defaultChannelBinding; diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/channels/annotations/SpringAnnotationMethodLevelChannelsScannerIntegrationTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/channels/annotations/SpringAnnotationMethodLevelChannelsScannerIntegrationTest.java index 2b1be9c94..4f64b080d 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/channels/annotations/SpringAnnotationMethodLevelChannelsScannerIntegrationTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/channels/annotations/SpringAnnotationMethodLevelChannelsScannerIntegrationTest.java @@ -19,7 +19,6 @@ import io.github.springwolf.core.asyncapi.components.examples.walkers.DefaultSchemaWalker; import io.github.springwolf.core.asyncapi.components.examples.walkers.json.ExampleJsonValueGenerator; import io.github.springwolf.core.asyncapi.scanners.bindings.BindingFactory; -import io.github.springwolf.core.asyncapi.scanners.bindings.common.BindingContext; import io.github.springwolf.core.asyncapi.scanners.common.channel.SpringAnnotationChannelService; import io.github.springwolf.core.asyncapi.scanners.common.headers.AsyncHeadersNotDocumented; import io.github.springwolf.core.asyncapi.scanners.common.headers.HeaderClassExtractor; @@ -316,11 +315,6 @@ public String getChannelName(TestChannelListener annotation) { return CHANNEL; } - @Override - public String getChannelName(TestChannelListener annotation, BindingContext bindingContext) { - return CHANNEL; - } - @Override public Map buildChannelBinding(TestChannelListener annotation) { return defaultChannelBinding; diff --git a/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/springwolf/examples/kafka/consumers/ExampleBeanRefKafkaListener.java b/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/springwolf/examples/kafka/consumers/ExampleBeanRefKafkaListener.java index 183fe3211..434c71f9a 100644 --- a/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/springwolf/examples/kafka/consumers/ExampleBeanRefKafkaListener.java +++ b/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/springwolf/examples/kafka/consumers/ExampleBeanRefKafkaListener.java @@ -19,7 +19,9 @@ @Slf4j public class ExampleBeanRefKafkaListener { + @SuppressWarnings("unused") public final String TOPIC_NAME = "example-topic-from-bean-ref"; + private final AnotherProducer anotherProducer; @KafkaListener(topics = "#{myListener.TOPIC_NAME}", beanRef = "myListener") diff --git a/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/asyncapi/scanners/bindings/AmqpBindingFactory.java b/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/asyncapi/scanners/bindings/AmqpBindingFactory.java index d6db2bc5e..80c53ebbd 100644 --- a/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/asyncapi/scanners/bindings/AmqpBindingFactory.java +++ b/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/asyncapi/scanners/bindings/AmqpBindingFactory.java @@ -6,7 +6,6 @@ import io.github.springwolf.asyncapi.v3.bindings.OperationBinding; import io.github.springwolf.asyncapi.v3.model.schema.SchemaObject; import io.github.springwolf.core.asyncapi.scanners.bindings.BindingFactory; -import io.github.springwolf.core.asyncapi.scanners.bindings.common.BindingContext; import org.springframework.amqp.core.Binding; import org.springframework.amqp.core.Exchange; import org.springframework.amqp.core.Queue; @@ -39,16 +38,6 @@ public String getChannelId(RabbitListener annotation) { return RabbitListenerUtil.getChannelId(annotation, stringValueResolver); } - @Override - public String getChannelId(RabbitListener annotation, BindingContext bindingContext) { - return BindingFactory.super.getChannelId(annotation, bindingContext); - } - - @Override - public String getChannelName(RabbitListener annotation, BindingContext bindingContext) { - return RabbitListenerUtil.getChannelName(annotation, stringValueResolver); - } - @Override public Map buildChannelBinding(RabbitListener annotation) { return RabbitListenerUtil.buildChannelBinding(annotation, stringValueResolver, context); diff --git a/springwolf-plugins/springwolf-sqs-plugin/src/main/java/io/github/springwolf/plugins/sqs/asyncapi/scanners/bindings/SqsBindingFactory.java b/springwolf-plugins/springwolf-sqs-plugin/src/main/java/io/github/springwolf/plugins/sqs/asyncapi/scanners/bindings/SqsBindingFactory.java index 7c0f06a79..047d191a2 100644 --- a/springwolf-plugins/springwolf-sqs-plugin/src/main/java/io/github/springwolf/plugins/sqs/asyncapi/scanners/bindings/SqsBindingFactory.java +++ b/springwolf-plugins/springwolf-sqs-plugin/src/main/java/io/github/springwolf/plugins/sqs/asyncapi/scanners/bindings/SqsBindingFactory.java @@ -7,7 +7,6 @@ import io.github.springwolf.asyncapi.v3.bindings.OperationBinding; import io.github.springwolf.asyncapi.v3.model.schema.SchemaObject; import io.github.springwolf.core.asyncapi.scanners.bindings.BindingFactory; -import io.github.springwolf.core.asyncapi.scanners.bindings.common.BindingContext; import lombok.RequiredArgsConstructor; import org.springframework.util.StringValueResolver; @@ -22,11 +21,6 @@ public String getChannelName(SqsListener annotation) { return SqsListenerUtil.getChannelName(annotation, stringValueResolver); } - @Override - public String getChannelName(SqsListener annotation, BindingContext bindingContext) { - return SqsListenerUtil.getChannelName(annotation, stringValueResolver); - } - @Override public Map buildChannelBinding(SqsListener annotation) { return SqsListenerUtil.buildChannelBinding(annotation, stringValueResolver); diff --git a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingMessageMappingFactory.java b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingMessageMappingFactory.java index 77fb8c7c2..0c788a088 100644 --- a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingMessageMappingFactory.java +++ b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingMessageMappingFactory.java @@ -6,7 +6,6 @@ import io.github.springwolf.asyncapi.v3.bindings.OperationBinding; import io.github.springwolf.asyncapi.v3.model.schema.SchemaObject; import io.github.springwolf.core.asyncapi.scanners.bindings.BindingFactory; -import io.github.springwolf.core.asyncapi.scanners.bindings.common.BindingContext; import io.github.springwolf.plugins.stomp.asyncapi.scanners.common.MessageMappingUtil; import io.github.springwolf.plugins.stomp.configuration.properties.SpringwolfStompConfigProperties; import lombok.RequiredArgsConstructor; @@ -25,11 +24,6 @@ public String getChannelName(MessageMapping annotation) { return properties.getEndpoint().getApp() + MessageMappingUtil.getChannelName(annotation, stringValueResolver); } - @Override - public String getChannelName(MessageMapping annotation, BindingContext bindingContext) { - return properties.getEndpoint().getApp() + MessageMappingUtil.getChannelName(annotation, stringValueResolver); - } - @Override public Map buildChannelBinding(MessageMapping annotation) { return MessageMappingUtil.buildChannelBinding(); diff --git a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingSendToFactory.java b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingSendToFactory.java index 6ac23885e..11728d2b5 100644 --- a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingSendToFactory.java +++ b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingSendToFactory.java @@ -6,7 +6,6 @@ import io.github.springwolf.asyncapi.v3.bindings.OperationBinding; import io.github.springwolf.asyncapi.v3.model.schema.SchemaObject; import io.github.springwolf.core.asyncapi.scanners.bindings.BindingFactory; -import io.github.springwolf.core.asyncapi.scanners.bindings.common.BindingContext; import io.github.springwolf.plugins.stomp.asyncapi.scanners.common.SendToUtil; import io.github.springwolf.plugins.stomp.configuration.properties.SpringwolfStompConfigProperties; import lombok.RequiredArgsConstructor; @@ -25,11 +24,6 @@ public String getChannelName(SendTo annotation) { return properties.getEndpoint().getApp() + SendToUtil.getChannelName(annotation, stringValueResolver); } - @Override - public String getChannelName(SendTo annotation, BindingContext bindingContext) { - return properties.getEndpoint().getApp() + SendToUtil.getChannelName(annotation, stringValueResolver); - } - @Override public Map buildChannelBinding(SendTo annotation) { return SendToUtil.buildChannelBinding(); diff --git a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingSendToUserFactory.java b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingSendToUserFactory.java index ec16f0e21..d62c097fb 100644 --- a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingSendToUserFactory.java +++ b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/bindings/StompBindingSendToUserFactory.java @@ -6,7 +6,6 @@ import io.github.springwolf.asyncapi.v3.bindings.OperationBinding; import io.github.springwolf.asyncapi.v3.model.schema.SchemaObject; import io.github.springwolf.core.asyncapi.scanners.bindings.BindingFactory; -import io.github.springwolf.core.asyncapi.scanners.bindings.common.BindingContext; import io.github.springwolf.plugins.stomp.asyncapi.scanners.common.SendToUserUtil; import io.github.springwolf.plugins.stomp.asyncapi.scanners.common.SendToUtil; import io.github.springwolf.plugins.stomp.configuration.properties.SpringwolfStompConfigProperties; @@ -26,11 +25,6 @@ public String getChannelName(SendToUser annotation) { return properties.getEndpoint().getUser() + SendToUserUtil.getChannelName(annotation, stringValueResolver); } - @Override - public String getChannelName(SendToUser annotation, BindingContext bindingContext) { - return properties.getEndpoint().getUser() + SendToUserUtil.getChannelName(annotation, stringValueResolver); - } - @Override public Map buildChannelBinding(SendToUser annotation) { return SendToUserUtil.buildChannelBinding();