org.apache.camel.component.elasticsearch.ElasticsearchComponent Java Examples
The following examples show how to use
org.apache.camel.component.elasticsearch.ElasticsearchComponent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ElasticsearchComponentAutoConfiguration.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Lazy @Bean(name = "elasticsearch-rest-component") @ConditionalOnMissingBean(ElasticsearchComponent.class) public ElasticsearchComponent configureElasticsearchComponent() throws Exception { ElasticsearchComponent component = new ElasticsearchComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, component, parameters, false); if (ObjectHelper.isNotEmpty(customizers)) { for (ComponentCustomizer<ElasticsearchComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.elasticsearch-rest.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.component.customizer", "camel.component.elasticsearch-rest.customizer"); if (useCustomizer) { LOGGER.debug("Configure component {}, with customizer {}", component, customizer); customizer.customize(component); } } } return component; }
Example #2
Source File: ElasticsearchIntegrationTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
private CamelContext createCamelContext() throws InterruptedException { CamelContext camelctx = new DefaultCamelContext(); ElasticsearchComponent elasticsearchComponent = new ElasticsearchComponent(); elasticsearchComponent.setHostAddresses(getElasticsearchHost()); camelctx.addComponent("elasticsearch-rest", elasticsearchComponent); return camelctx; }
Example #3
Source File: K8ElasticSearchEndpoint.java From funktion-connectors with Apache License 2.0 | 4 votes |
public K8ElasticSearchEndpoint(String uri, ElasticsearchComponent component, K8ElasticSearchConfiguration config, Client client) throws Exception { super(uri, component,config,client); this.elasticSearchConfiguration = config; }