diff --git a/spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java b/spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java index 126eae54..79de1ca8 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2017 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. @@ -523,7 +523,7 @@ public class KafkaListenerAnnotationBeanPostProcessor resolveAsString(object, result); } } - if (resolvedValue instanceof String) { + else if (resolvedValue instanceof String) { result.add((String) resolvedValue); } else if (resolvedValue instanceof Iterable) { diff --git a/spring-kafka/src/test/java/org/springframework/kafka/annotation/EnableKafkaIntegrationTests.java b/spring-kafka/src/test/java/org/springframework/kafka/annotation/EnableKafkaIntegrationTests.java index b2d80c41..e3dfea22 100644 --- a/spring-kafka/src/test/java/org/springframework/kafka/annotation/EnableKafkaIntegrationTests.java +++ b/spring-kafka/src/test/java/org/springframework/kafka/annotation/EnableKafkaIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 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. @@ -88,7 +88,8 @@ public class EnableKafkaIntegrationTests { public Listener listener; @ClassRule - public static KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, "annotated1", "annotated2", "annotated3", + public static KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, + "annotated1", "annotated2", "annotated3", "annotated4", "annotated5", "annotated6", "annotated7", "annotated8", "annotated9", "annotated10", "annotated11", "annotated12", "annotated13"); @@ -433,7 +434,7 @@ public class EnableKafkaIntegrationTests { public void manualStart(String foo) { } - @KafkaListener(id = "foo", topics = "${topicOne:annotated1}") + @KafkaListener(id = "foo", topics = "#{'${topicOne:annotated1,foo}'.split(',')}") public void listen1(String foo) { this.latch1.countDown(); }