How do I use Spring Expression Language for an Array in an annotation with Scala
问题 I have a simple Scala project that looks like this... @Configuration public class CommonConfiguration{ ... @Value("${spring.kafka.topic}") public String topic; ... } @Service class KafkaService @Autowired()(producer: KafkaTemplate[String, Array[Byte]], config: CommonConfiguration){ def sendMessage(msg: String): Unit = { println(s"Writing the message $msg ${config.topic}") producer.send(config.topic, msg.getBytes()); } @KafkaListener(id="test", topics="#{'${spring.kafka.topic}'.split(',')}")