@Incoming("from-processor-to-consumer")
public Multi<Void> consume(Multi<String> stream) {
return stream.onItem()
.invoke(msg -> {
log.infof("consumer received %s", msg);
})
.onItem()
.ignore();
}
运行此方法时会引发ClassCastException
:
consume has thrown an exception: java.lang.ClassCastException: class java.lang.String cannot be cast to class io.smallrye.mutiny.Multi
我可以消费Multi<String>
吗?
查看SmallRye Reactive Messaging > Development Model > Consuming Payloads似乎我一次只能使用一条消息。