Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 70F13200C6F for ; Mon, 24 Apr 2017 10:24:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6E6F8160B99; Mon, 24 Apr 2017 08:24:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C70B8160BA5 for ; Mon, 24 Apr 2017 10:24:37 +0200 (CEST) Received: (qmail 73982 invoked by uid 500); 24 Apr 2017 08:24:36 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 73967 invoked by uid 99); 24 Apr 2017 08:24:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Apr 2017 08:24:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 94AEBE152F; Mon, 24 Apr 2017 08:24:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Mon, 24 Apr 2017 08:24:37 -0000 Message-Id: In-Reply-To: <8893f834498545a68bd9dd2937905e0e@git.apache.org> References: <8893f834498545a68bd9dd2937905e0e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] camel git commit: Added the provision to pass Solr Params when pushing SolrInputDocuments. archived-at: Mon, 24 Apr 2017 08:24:38 -0000 Added the provision to pass Solr Params when pushing SolrInputDocuments. This change is necessary when you intend to have an update processor chain to be trigerred or any such for which parameters are to be passed along with the url. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/40da9709 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/40da9709 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/40da9709 Branch: refs/heads/camel-2.18.x Commit: 40da970914a969b159a852e25b0b26aaf3f96892 Parents: bf6a985 Author: Chirag Anand Authored: Mon Apr 24 10:43:08 2017 +0530 Committer: Claus Ibsen Committed: Mon Apr 24 10:24:26 2017 +0200 ---------------------------------------------------------------------- .../org/apache/camel/component/solr/SolrProducer.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/40da9709/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java index 0052b7d..2a662d6 100644 --- a/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java +++ b/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java @@ -137,6 +137,13 @@ public class SolrProducer extends DefaultProducer { UpdateRequest updateRequest = new UpdateRequest(getRequestHandler()); updateRequest.add((SolrInputDocument) body); + for (Map.Entry entry : exchange.getIn().getHeaders().entrySet()) { + if (entry.getKey().startsWith(SolrConstants.PARAM)) { + String paramName = entry.getKey().substring(SolrConstants.PARAM.length()); + updateRequest.setParam(paramName, entry.getValue().toString()); + } + } + updateRequest.process(solrServer); } else if (body instanceof List) { @@ -146,6 +153,13 @@ public class SolrProducer extends DefaultProducer { UpdateRequest updateRequest = new UpdateRequest(getRequestHandler()); updateRequest.add((List) list); + for (Map.Entry entry : exchange.getIn().getHeaders().entrySet()) { + if (entry.getKey().startsWith(SolrConstants.PARAM)) { + String paramName = entry.getKey().substring(SolrConstants.PARAM.length()); + updateRequest.setParam(paramName, entry.getValue().toString()); + } + } + updateRequest.process(solrServer); } else { invalid = true;