![](/img/trans.png)
[英]EnableBinding is deprecated in Spring Cloud Stream 3.x
[英]What does @EnableBinding in Cloud Stream do in the back?
我目前正在使用 spring 雲流。 我正在使用@EnableBinding annotation。 但我不知道這在后面做什么。 當我查看 Springin 的官方網站時,我並沒有得到太多。 你能詳細給我解釋一下嗎?
我還有一個問題。
public interface Sink {
String INPUT = "input";
@Input(Sink.INPUT)
SubscribableChannel input();
}
@SpringBootApplication
@EnableBinding(Sink.class)
public class VoteRecordingSinkApplication {
public static void main(String[] args) {
SpringApplication.run(VoteRecordingSinkApplication.class, args);
}
@StreamListener(Sink.INPUT)
public void processVote(Vote vote) {
votingService.recordVote(vote);
}
}
為什么Spring需要這個接口?我只是希望我們可以寫streamlistener。 后面怎么回事?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.