Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1442B2AB0 for ; Sat, 23 Apr 2011 14:41:00 +0000 (UTC) Received: (qmail 98798 invoked by uid 500); 23 Apr 2011 14:40:59 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 98767 invoked by uid 500); 23 Apr 2011 14:40:59 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 98759 invoked by uid 99); 23 Apr 2011 14:40:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Apr 2011 14:40:59 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Apr 2011 14:40:54 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.69) (envelope-from ) id 1QDe0g-0000LX-Hy for users@camel.apache.org; Sat, 23 Apr 2011 07:40:34 -0700 Date: Sat, 23 Apr 2011 07:40:34 -0700 (PDT) From: "ben.oday" To: users@camel.apache.org Message-ID: <1303569634551-4334748.post@n5.nabble.com> In-Reply-To: <1303371763904-4330195.post@n5.nabble.com> References: <1303364025369-4330030.post@n5.nabble.com> <1303366123903-4330067.post@n5.nabble.com> <1303371763904-4330195.post@n5.nabble.com> Subject: Re: how can i modify variable bases xpath in configure() method MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit see this example...http://camel.apache.org/recipientlist-annotation.html aronftd wrote: > > i define MessageRouter in spring xml ,when i be in debug mode ,i find the > apc3AddrMap property is null; > but i test MessageRouter not in camel ,it can get the map property , > how can i do ,thanks! > > > > public class FileToJMSRouter extends RouteBuilder { > > public String rcvQ; > public String sendQ; > @Override > public void configure() throws Exception { > // load file orders from src/data into the JMS queue > // DataFormat jaxb = new > JaxbDataFormat("com.sinosky.cdip.route.xsd.rply"); > String sendQStr = "jms:" + sendQ; > String rcvQStr = "jms:" + rcvQ; > errorHandler(defaultErrorHandler() > .maximumRedeliveries(2) > .redeliveryDelay(1000) > .retryAttemptedLogLevel(LoggingLevel.WARN)); > from("file:src/data?delay=1000") > .to(sendQStr) > > .to("file:logs/send?fileName=${date:now:yyyy-MM-dd}/${exchangeId}.xml") > .recipientList().method(MessageRouter.class, "routeTo") > .setBody(constant("success")) > .to(rcvQStr) > > .to("file:logs/receive?fileName=${date:now:yyyy-MM-dd}/${exchangeId}.xml"); > ; > } > public String getRcvQ() { > return rcvQ; > } > public void setRcvQ(String rcvQ) { > this.rcvQ = rcvQ; > } > public String getSendQ() { > return sendQ; > } > public void setSendQ(String sendQ) { > this.sendQ = sendQ; > } > } > > > public class MessageRouter { > private Map<String,String> apc3AddrMap; > > public Map<String, String> getApc3AddrMap() { > return apc3AddrMap; > } > > public void setApc3AddrMap(Map<String, String> apc3AddrMap) > { > this.apc3AddrMap = apc3AddrMap; > } > public String routeTo(@XPath("/R/RCV/APC3/text()") String key) { > String str = apc3AddrMap.get(key); > return str; > } > > } > ----- Ben O'Day IT Consultant -http://benoday.blogspot.com -- View this message in context: http://camel.465427.n5.nabble.com/how-can-i-modify-variable-bases-xpath-in-configure-method-tp4330030p4334748.html Sent from the Camel - Users mailing list archive at Nabble.com.