You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2015/01/30 05:53:47 UTC
[1/3] camel git commit: CAMEL-8299 Let BulkRequest return the whole
BulkResponse
Repository: camel
Updated Branches:
refs/heads/master d4780c755 -> 17f31529b
CAMEL-8299 Let BulkRequest return the whole BulkResponse
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8980feb2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8980feb2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8980feb2
Branch: refs/heads/master
Commit: 8980feb2366f8d0c22df142fbf8a6f557a2037f5
Parents: d4780c7
Author: Ziv Segal <zi...@logshero.com>
Authored: Wed Jan 21 13:19:29 2015 +0200
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Jan 30 11:46:15 2015 +0800
----------------------------------------------------------------------
.../camel/component/elasticsearch/ElasticsearchProducer.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/8980feb2/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
index 3d6e604..a761c4d 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchProducer.java
@@ -27,6 +27,7 @@ import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.index.IndexRequest;
+import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.client.Client;
/**
@@ -114,12 +115,7 @@ public class ElasticsearchProducer extends DefaultProducer {
message.setBody(client.get(getRequest));
} else if (ElasticsearchConfiguration.OPERATION_BULK_INDEX.equals(operation)) {
BulkRequest bulkRequest = message.getBody(BulkRequest.class);
- List<String> indexedIds = new LinkedList<String>();
- for (BulkItemResponse response : client.bulk(bulkRequest).actionGet().getItems()) {
- indexedIds.add(response.getId());
- }
- log.debug("List of successfully indexed document ids : {}", indexedIds);
- message.setBody(indexedIds);
+ message.setBody(client.bulk(bulkRequest).actionGet());
} else if (ElasticsearchConfiguration.OPERATION_DELETE.equals(operation)) {
DeleteRequest deleteRequest = message.getBody(DeleteRequest.class);
message.setBody(client.delete(deleteRequest).actionGet());
[3/3] camel git commit: CAMEL-8298 Remove the spring-test dependency
from camel-spring-javaconfig
Posted by ni...@apache.org.
CAMEL-8298 Remove the spring-test dependency from camel-spring-javaconfig
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/17f31529
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/17f31529
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/17f31529
Branch: refs/heads/master
Commit: 17f31529b1625dbc61e43a81ceb38dc24665acc0
Parents: 0541880
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Jan 30 11:33:44 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Jan 30 12:51:52 2015 +0800
----------------------------------------------------------------------
components/camel-spring-javaconfig/pom.xml | 4 +-
.../test/JavaConfigContextLoader.java | 130 -------------------
2 files changed, 2 insertions(+), 132 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/17f31529/components/camel-spring-javaconfig/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring-javaconfig/pom.xml b/components/camel-spring-javaconfig/pom.xml
index a266677..93a4d10 100644
--- a/components/camel-spring-javaconfig/pom.xml
+++ b/components/camel-spring-javaconfig/pom.xml
@@ -17,7 +17,7 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
-
+
<parent>
<artifactId>components</artifactId>
<groupId>org.apache.camel</groupId>
@@ -32,7 +32,7 @@
<properties>
<camel.osgi.export.pkg>org.apache.camel.spring.javaconfig.*</camel.osgi.export.pkg>
</properties>
-
+
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
http://git-wip-us.apache.org/repos/asf/camel/blob/17f31529/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/test/JavaConfigContextLoader.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/test/JavaConfigContextLoader.java b/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/test/JavaConfigContextLoader.java
deleted file mode 100644
index 274296c..0000000
--- a/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/test/JavaConfigContextLoader.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.spring.javaconfig.test;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-import org.springframework.test.context.ContextLoader;
-
-/**
- * Implementation of the {@link ContextLoader} strategy for creating a
- * {@link org.springframework.context.annotation.AnnotationConfigApplicationContext} for a test's
- * {@link org.springframework.test.context.ContextConfiguration @ContextConfiguration}
- * <p/>
- *
- * Example usage: <p/>
- * <pre class="code">
- * @RunWith(SpringJUnit4ClassRunner.class)
- * @ContextConfiguration(locations = {"com.myco.TestDatabaseConfiguration", "com.myco.config"},
- * loader = JavaConfigContextLoader.class)
- * public MyTests { ... }
- * </pre>
- * <p/>
- *
- * Implementation note: At this time, due to restrictions in Java annotations and Spring's
- * TestContext framework, locations of classes / packages must be specified as strings to
- * the ContextConfiguration annotation. It is understood that this has a detrimental effect
- * on type safety, discoverability and refactoring, and for these reasons may change in
- * future revisions, possibly with a customized version of the ContextConfiguration annotation
- * that accepts an array of class literals to load.
- *
- * @see org.springframework.test.context.ContextConfiguration
- * @deprecated Use org.apache.camel.test.spring.CamelSpringDelegatingTestContextLoader from
- * camel-test-spring jar instead.
- */
-@Deprecated
-public class JavaConfigContextLoader implements ContextLoader {
-
- protected final Logger logger = LoggerFactory.getLogger(getClass());
-
- /**
- * Simply returns the supplied <var>locations</var> unchanged.
- * <p/>
- *
- * @param clazz the class with which the locations are associated: used to determine how to
- * process the supplied locations.
- * @param locations the unmodified locations to use for loading the application context; can be
- * {@code null} or empty.
- * @return an array of application context resource locations
- * @see org.springframework.test.context.ContextLoader#processLocations(Class, String[])
- */
- public String[] processLocations(Class<?> clazz, String... locations) {
- return locations;
- }
-
- /**
- * Loads a new {@link ApplicationContext context} based on the supplied {@code locations},
- * configures the context, and finally returns the context in fully <em>refreshed</em> state.
- * <p/>
- *
- * Configuration locations are either fully-qualified class names or base package names. These
- * locations will be given to a {@link AnnotationConfigApplicationContext} for configuration via the
- * {@link AnnotationConfigApplicationContext#register(Class[])} and
- * {@link AnnotationConfigApplicationContext#scan(String...)} methods.
- *
- * @param locations the locations to use to load the application context
- * @return a new application context
- * @throws IllegalArgumentException if any of <var>locations</var> are not valid fully-qualified
- * Class or Package names
- */
- public ApplicationContext loadContext(String... locations) {
- if (logger.isDebugEnabled()) {
- logger.debug("Creating a JavaConfigApplicationContext for {}", Arrays.asList(locations));
- }
-
- AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
-
- List<Class<?>> configClasses = new ArrayList<Class<?>>();
- List<String> basePackages = new ArrayList<String>();
- for (String location : locations) {
- // if the location refers to a class, use it. Otherwise assume it's a base package name
- try {
- final Class<?> aClass = this.getClass().getClassLoader().loadClass(location);
- configClasses.add(aClass);
- } catch (ClassNotFoundException e) {
- if (Package.getPackage(location) == null) {
- throw new IllegalArgumentException(
- String.format("A non-existent class or package name was specified: [%s]", location));
- }
- basePackages.add(location);
- }
- }
-
- logger.debug("Setting config classes to {}", configClasses);
- logger.debug("Setting base packages to {}", basePackages);
-
- for (Class<?> configClass : configClasses) {
- context.register(configClass);
- }
-
- for (String basePackage : basePackages) {
- context.scan(basePackage);
- }
-
- context.refresh();
-
- return context;
- }
-
-}
[2/3] camel git commit: CAMEL-8298 Remove unused spring-test
dependency
Posted by ni...@apache.org.
CAMEL-8298 Remove unused spring-test dependency
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0541880b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0541880b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0541880b
Branch: refs/heads/master
Commit: 0541880b19391752b7f4dd918791ec66fa30dd7b
Parents: 8980feb
Author: Nathan Jones <na...@ncjones.com>
Authored: Fri Jan 30 00:29:27 2015 +1300
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Jan 30 12:51:51 2015 +0800
----------------------------------------------------------------------
components/camel-spring-javaconfig/pom.xml | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/0541880b/components/camel-spring-javaconfig/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring-javaconfig/pom.xml b/components/camel-spring-javaconfig/pom.xml
index 369ae75..a266677 100644
--- a/components/camel-spring-javaconfig/pom.xml
+++ b/components/camel-spring-javaconfig/pom.xml
@@ -46,11 +46,7 @@
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>