未解析的参考:来源 - org.springframework.cloud.stream.messaging.source

问题描述 投票:0回答:1

由于存在漏洞,我正在更新一些项目库,更新后我无法完成此导入工作:

import org.springframework.cloud.stream.messaging.Source 
(“来源”在 InteliJ 中为红色)

错误消息是:“未解决的参考:来源”。

我有红色,它是此依赖项的一部分:

<dependency>
 <groupId> org.springframework.cloud</groupId>
 <artifactId> spring-cloud-stream </artifactId>
 <version>4.0.4
</dependency>

但是这是一个 Kotlin(我对 Kotlin 不太熟悉:-/)项目,所以我发现我应该使用这个?

<dependency>
 <groupId>org.springframework.cloud</groupId>
 <artifactId>spring-cloud-stream-binder-kafka</artifactId>
</dependency>

不幸的是,这两个依赖项都不能解决这个问题(当我这样做时:mvn clean install -U)。

如果有任何建议,我会很高兴!

java spring kotlin maven spring-cloud-stream
1个回答
0
投票

嗯,基于注释的编程模型,其中包括诸如

StreamListener, Source, EnableBinding
等类。 。早已被弃用并从代码库中删除。 我们已经切换到更强大的功能模型 - https://docs.spring.io/spring-cloud-stream/docs/current/reference/html/spring-cloud-stream.html#_having_and_sculpts_messages

© www.soinside.com 2019 - 2024. All rights reserved.