ElasticsearchComponent elasticsearchComponent = new ElasticsearchComponent();
elasticsearchComponent.setHostAddresses("myelkhost:9200");
camelContext.addComponent("elasticsearch-rest", elasticsearchComponent);
ElasticsearchComponent elasticsearchComponent = new ElasticsearchComponent();
elasticsearchComponent.setHostAddresses("myelkhost:9200");
camelContext.addComponent("elasticsearch-rest", elasticsearchComponent);
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
对于使用 elasticsearch 的基本身份验证,或使用 elasticsearch 集群前面的反向 http 代理,只需在组件上设置基本身份验证和 SSL,如下例所示
ElasticsearchComponent elasticsearchComponent = new ElasticsearchComponent();
elasticsearchComponent.setHostAddresses("myelkhost:9200");
elasticsearchComponent.setUser("elkuser");
elasticsearchComponent.setPassword("secure!!");
elasticsearchComponent.setEnableSSL(true);
camelContext.addComponent("elasticsearch-rest", elasticsearchComponent);
ElasticsearchComponent elasticsearchComponent = new ElasticsearchComponent();
elasticsearchComponent.setHostAddresses("myelkhost:9200");
elasticsearchComponent.setUser("elkuser");
elasticsearchComponent.setPassword("secure!!");
elasticsearchComponent.setEnableSSL(true);
camelContext.addComponent("elasticsearch-rest", elasticsearchComponent);
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow