admin管理员组文章数量:1127954
I should migrate from Spring Boot 2 to Spring Boot 3 and I had problems with kinesis. There is no error, the problem is that I do not receive the messages present in the stream. I think it could be a configuration problem but I do not know how to fix them. any answer will be appriciated
I have updated the dependencies as follow in my pom:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
...
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
<version>4.1.4</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2024.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2024.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-aws-dependencies</artifactId>
<version>3.1.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
The code I was using was:
@Bean
public Consumer<String> authorization() {
return message -> {
log.info(message);
// logic here
};
}
properties:
spring:
cloud:
stream:
function:
definition: authorization
bindings:
authorization-in-0:
destination: authorizationDestination
group: authorization1
Everyting worked in the previous version because the configuration was based on convention name.
In particolar in order to create a consumer that receive message under the property "binding" you have to insert STREAM_NAME-in-0 and then create a bean with that stream name. In my case I have "authorization-in-0" and @Bean public Consumer<String> authorization() {...}.
You can find more information here:
.html
and here:
I tried different versions of the dependencies and @StreamListener is already deprecated so I would like to avoid to include something already deprecated.
本文标签: Spring Cloud Stream Kinesis Binder with Spring 3Stack Overflow
版权声明:本文标题:Spring Cloud Stream Kinesis Binder with Spring 3 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736709592a1948865.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论