作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
假设我有这样的 elasticsearch 实例:
from("direct:index") .to("elasticsearch://local?operation=INDEX&indexName=twitter&我添加了 10 条推文,如何从 elasticsearch 获取该推文的所有列表?我尝试过这样的事情:
indexType=tweet");
from("elasticsearch://local?operation=MULTIGET&indexName=twitter& indexType=tweet").process(new MyProcessor()) .to("direct:somewhere")但它不起作用,你能帮我做到这一点吗?处理器中的数据是什么类型?
我需要使用 apache Camel DSL 获取所有推文的列表,你能帮我做到这一点吗?
最佳答案
只是猜测,但是 Camel Elastic页面显示 MULTIGET
Retrieves the specified indexes type's specified in MultigetRequest and returns a MultigetResponse object in the body
所以我想您必须在消息正文中提供一个 MultigetRequest
对象,然后在 Elastic 中执行搜索。
这意味着您不能通过 from(...)
直接将其用作 Consumer,但您必须使用 .to(...)
调用它code> 并确保消息包含正确的正文。
关于java - 如何使用apachecamel从elasticsearch获取所有条目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56937993/
我在一个Spring Boot应用程序中有以下路线。并进行以下测试。第二个测试的目的是验证如果将消息“{}”发送到DIRECT:LOG终结点,它将超出To(Bean-validator://check
我是一名优秀的程序员,十分优秀!