自定义event,在发送后在Kafka中并没有出现新增的消息
发布事件的代码
protected void fireEvent(String eventAction, Product productDto) {
ProductEvent productEvent = new ProductEvent(productDto,
context.getId(), "service-hello:**",
eventAction, productDto.getItemCode());
// 发布事件
context.publishEvent(productEvent);
}
yml配置
server:
port: 2100
spring:
application:
name: SERVICE-HELLO
cloud:
stream:
bindings:
output:
destination: twostepsfromjava-cloud-producttopic
content-type: application/json
kafka:
binder:
brokers: localhost:9092
代码没有报错,但是执行完kafka对应的topic没有消息
同样的代码旧版本可以Daston可以,有没有知道解决办法,或者给个可以的greenwitch版本的demo