新增:消费对象初始化是否 开启事件监听控制

This commit is contained in:
lxy
2020-09-19 13:49:50 +08:00
parent 4a7217f85f
commit 4b3849b66e
4 changed files with 9 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ public class MyConsumer extends KafakConsumer {
}
@Override
public void preInit() {
public boolean preInit() {
addEventType(
EventType.of("a1", new TypeToken<Float>() {
}, r -> {
@@ -23,5 +23,7 @@ public class MyConsumer extends KafakConsumer {
System.out.println("我收到了消息 主题bx 事件:" + str);
})
);
return true;
}
}