【发布时间】:2018-05-17 20:28:39
【问题描述】:
here 仅描述了一种发布方式。 还有另一种方法吗? 我需要在没有persistentEntityRegistry的情况下使用动态主题ID和自定义事件进行发布的示例? 以及如何使用 eventId 发布事件?
@Override
default Descriptor descriptor() {
return named("helloservice").withCalls(
pathCall("/api/hello/:id", this::hello),
pathCall("/api/event/:id", this::pushEventWithId) // id - eventId
)
.withTopics(
topic(GREETINGS_TOPIC, this::greetingsTopic)
)
.withAutoAcl(true);
}
处理请求。
public ServiceCall<RequestMessage, NotUsed> pushEventWithId(String eventId) {
return message -> {
// Here I need push this message to kafka with eventId. Another service should be subscribed on this eventId
}
}
Lagom 版本:1.3.10
【问题讨论】:
标签: java apache-kafka publish-subscribe lagom