Spring for Apache Kafka 2.0 的首个里程碑版本发布了 -- Spring For Apache Kafka 2.0.0.M1。
Spring for Apache Kafka 用于为 Apache Kafka 提供熟悉的 Spring 抽象。
2.0 系列中的重要新功能包括:
在 KafkaTemplate 中支持时间戳
Seek to beginning/end of topics
New threading model facilitated by KIP-62 - now that the consumer client does not rely on poll() being called frequently, the threading model is much simpler; avoiding the need for internal pause() / resume() processing. Listeners are now always invoked on the consumer thread. This, in turn, has facilitated:
ConsumerAwareMessageListener (and BatchConsumerAwareMessageListener) are provided so that listener implementations can access the Consumer, ?> object to perform operations such as pause(), resume(), metrics() etc.
@KafkaListener POJO methods can now be annotated with @SendTo to send the method result to some other topic.[code]@KafkaListener(id = "replyingListener", topics = "inTopic")
@SendTo("replyTopic")
public String replyingListener(String in) {
return in.toUpperCase();
}[/code]软件详情:http://docs.spring.io/spring-kafka/docs/2.0.0.BUILD-SNAPSHOT/reference/html/_reference.html#annotation-send-to
下载地址:https://github.com/spring-projects/spring-kafka/archive/v2.0.0.M1.zip
来自:开源中国社区