弹性和骆驼整合 [英] elasticsearch and camel integration

查看:157
本文介绍了弹性和骆驼整合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将骆驼与弹性搜索整合在一起。
在applicationContext.xml中添加了以下

 < route id =timer-to-console> 
< from uri =timer:// foo?fixedRate = true& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp
< transform>
< simple> Hello Web应用程序,你好吗?< / simple>
< / transform>
< to uri =stream:out/>
< to uri =elasticsearch:// local/>
< / route>

然后当我运行

  mvn jetty:运行

我得到以下

  veryCounter = 0,firedTime = Mon Apr 21 13:14:43 PDT 2014} 
BodyType String
Body Hello Web应用程序, 你好吗?
]

Stacktrace
-------------------------------- -------------------------------------------------- ------
java.lang.IllegalArgumentException:操作在org.apache.camel.component.elasticsearch.ElasticsearchProducer.process(ElasticsearchProducer.java:54)$ org
.apache.camel.util.AsyncProcessorConverterHelper $ ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)

我的弹性搜索在本地运行,我正在使用ES 1.1.1。



我需要为

  elasticsearch:// clusterName [?options] 

谢谢,从$ a href =https://camel.apache.org/elasticsearch.html = nofollow> Apache Camel Elasticsearch Component 页面,它们显示了以下示例:


elasticsearch:// local?operation = INDEX& ; indexName = twitter& indexType = tweet


这将INDEX(添加)到名为 twitter 类型为 tweet 。您可以使用indexName和indexType所需的任何值。



更新:再次查看Elasticsearch骆驼组件文档...我想为了在弹性搜索连接中使用 local 作为服务器名称,您需要使用本地的群集名称运行本地Elasticsearch实例。默认情况下,Elasticsearch配置(elasticsearch.yml)设置为运行的集群名称为 elasticsearch


I am trying to integrate camel with elasticsearch. In applicationContext.xml added the following

 <route id="timer-to-console">
        <from uri="timer://foo?fixedRate=true&amp;period=10s"/>
        <transform>
           <simple>Hello Web Application, how are you?</simple>
        </transform>
        <to uri="stream:out"/>
        <to uri="elasticsearch://local"/>
    </route>

Then when I run

mvn jetty:run

I am getting the following

veryCounter=0, firedTime=Mon Apr 21 13:14:43 PDT 2014}
BodyType            String
Body                Hello Web Application, how are you?
]

 Stacktrace
  ----------------------------------------------------------------------------------------      
 java.lang.IllegalArgumentException: operation is missing
at    org.apache.camel.component.elasticsearch.ElasticsearchProducer.process(ElasticsearchProducer.java:54)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)

My elasticsearch is running locally, I am using ES 1.1.1.

what do I need to specify for

elasticsearch://clusterName[?options]

Thanks,

解决方案

From a quick glance at the Apache Camel Elasticsearch Component page they show the following example:

elasticsearch://local?operation=INDEX&indexName=twitter&indexType=tweet

This would INDEX (add) into an index named twitter with a type of tweet. You can use whatever values you want for the indexName and indexType.

Update: Looking at the Elasticsearch Camel Component documentation again... I think in order to use local as the server name in the elasticsearch connection, you would need to be running your local Elasticsearch instance with a clustername of local. By default Elasticsearch configuration (elasticsearch.yml) is setup to run with a clustername of elasticsearch

这篇关于弹性和骆驼整合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆