JoonT
JoonT

Reputation: 1246

spring cloud stream binder kafka doesn't work

Now I'm trying to create Message Service function with kafka to use spring-cloud-stream-bind-kafka, but didn't work so well.

Configuration:
spring boot 1.4.2

build.gradle:

compile "org.springframework.cloud:spring-cloud-stream:2.0.1.RELEASE"
compile "org.springframework.cloud:spring-cloud-stream-binder-kafka:2.0.1.RELEASE"

code:

@EnableBindings(MessagePublish.class)
class MessageConfiguration {
}

interface MessagePublish {
    @Output("test")
    MessageChannel publish();
}

class TestService {
    @Autowired
    MessagePublish messagePublish;

    public void doSomething() {
        // do something
        messagePublish.publish().send(MessageBuilder.withPayload("test").build());
    }
}

It failed when I start the project with this error log

Caused by: org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanTypeDeductionException: Failed to deduce bean type for org.springframework.cloud.stream.config.BindingServiceConfiguration.bindingService
....
Caused by: java.lang.ClassNotFoundException: org.springframework.integration.support.converter.ConfigurableCompositeMessageConverter

I'm suspecting my spring boot version. It's so low version.
I think spring-cloud-stream-binder-kafka can't be used under spring boot 2.0 version or other reasons.

I don't know how can I do and how can I explore this situation...
If you give me a little advice, I really appreciate you.

Upvotes: 0

Views: 1832

Answers (1)

jumb0jet
jumb0jet

Reputation: 910

If you are using Spring Boot 1.4.x version then you should use the Spring Cloud Camden release train.

https://github.com/spring-projects/spring-cloud/wiki/Spring-Cloud-Camden-Release-Notes

In particular, you should use the following versions:

compile "org.springframework.cloud:spring-cloud-stream:1.1.2.RELEASE"
compile "org.springframework.cloud:spring-cloud-stream-binder-kafka:1.1.2.RELEASE"

Upvotes: 1

Related Questions