게시 방법 중 하나만 설명합니다 here. 다른 방법이 있습니까? 이 예제에서는 persistentEntityRegistry를 사용하지 않고 동적 항목 ID와 사용자 지정 이벤트로 게시해야합니다. 그리고 eventId로 이벤트를 게시하려면 어떻게해야합니까?카프카 (Kafka)와의 Lagom 게시 메시지
@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
답변 해 주셔서 감사합니다. 카프카 클라이언트에서 직접 해냈습니다. –