我的列表为:
@Bean
fun userConsumerConfigs(): Map<String, Any> {
val props = HashMap<String, Any>()
props[ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG] = "$host:$port"
props[ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG] = StringDeserializer::class.java
props[ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG] = JsonDeserializer::class.java
props[ConsumerConfig.GROUP_ID_CONFIG] = "helloworld"
return props
}
@Bean
fun userConsumerFactory(): ConsumerFactory<String, EmailSent> {
return DefaultKafkaConsumerFactory(userConsumerConfigs(), StringDeserializer(), JsonDeserializer<>(EmailSent::class))
}
我要删除所有连续变量。
我期望的输出是:
l=["a","a","a","a","d","a","d","d"]