Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 62111 invoked from network); 15 Jan 2009 09:11:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Jan 2009 09:11:17 -0000 Received: (qmail 57912 invoked by uid 500); 15 Jan 2009 09:11:16 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 57893 invoked by uid 500); 15 Jan 2009 09:11:16 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 57882 invoked by uid 99); 15 Jan 2009 09:11:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jan 2009 01:11:16 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jan 2009 09:11:08 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LNOFU-00087K-7Y for camel-user@activemq.apache.org; Thu, 15 Jan 2009 01:10:48 -0800 Message-ID: <21473876.post@talk.nabble.com> Date: Thu, 15 Jan 2009 01:10:48 -0800 (PST) From: Liav Ezer To: camel-user@activemq.apache.org Subject: Re: Problem using camel-2.0 API in SMX In-Reply-To: <21473350.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: liav.ezer@gmail.com References: <21460207.post@talk.nabble.com> <5380c69c0901142131k1c119408m60ba808ceec5bf7e@mail.gmail.com> <21472159.post@talk.nabble.com> <5380c69c0901142336s28067af0j42584ae09227934b@mail.gmail.com> <21473302.post@talk.nabble.com> <21473350.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi Claus, I'm having difficulties adjusting your example. Currently i have an independent class for the builder & for the processor (not inner class). This is my builder: public class OxpRouteBuilder extends RouteBuilder { public void configure() throws Exception { from("jbi:service:http://oxp/oXpInternalService") .process(new OXpServicesAuthenticationProcessor()); } } This is my processor: class OXpServicesAuthenticationProcessor implements Processor{ public OXpServicesAuthenticationProcessor() { } public void process(Exchange exchange) throws Exception { String policyContentRequest = getPolicyContentRequest(exchange); if(!userIsAuthenticate( exchange , policyContentRequest)){ String errMsg = "User is not authorized to perform the activity!"; exchange.getIn().setBody(errMsg); throw new Exception(errMsg ); } routeMessage(exchange); } } This is my camel-context: com.liav.oxp.esb.poc My question is: 1.Can i "wire" up your example to my architecture or should i create a different router builder like yours? When i added to my builder's configure method the "addInterceptStrategy" i got NoSuchMethodException in deployment. 2. If i need to use your architecture, which definition of the camel-context file should i add to support this interceptor? Thanks. Liav Ezer wrote: > > Oh sorry igot the answer from: > > http://activemq.apache.org/camel/how-do-i-reuse-the-contexttestsupport-class-in-my-unit-tests.html > > > > Liav Ezer wrote: >> >> I don't have the org.apache.camel.ContextTestSupport in my maven >> repository. >> >> Which dependency should i add to the camel SU's pom file? >> >> Thanks. >> >> Claus Ibsen-2 wrote: >>> >>> Hi >>> >>> I have created an unit test in Camel 1.x that simulates the >>> fromEndpointUri using an interceptor instead. >>> Its 99% as good :) >>> >>> Check out: >>> org.apache.camel.processor.interceptor.SimulateFromEndpointUsingInterceptorTest >>> >>> That I will commit in a short time. >>> >>> Then you will be able to get the fromEndpointUri from a Exchange >>> property. >>> >>> >>> On Thu, Jan 15, 2009 at 7:34 AM, Liav Ezer wrote: >>>> >>>> Hi Claus, >>>> >>>> My use case is: each new service need to have a consumer & a provider >>>> in my >>>> application. >>>> >>>> Therefore, i need to dynamically build (via producer template) an >>>> End-Point >>>> & access it. >>>> >>>> My assumption is that the provider & consumer end-points (BC's) will >>>> have >>>> the same name (prefix), only change will be the postfix >>>> (Provider >>>> vs Consumer). >>>> >>>> If i can gain knowledge on my FromEndPoing at DSL run time, i can >>>> dynamically create a provider end-point based on the consumer name >>>> (instead >>>> of doing it hard coded). >>>> >>>> Thanks Claus. >>>> >>>> >>>> >>>> >>>> Claus Ibsen-2 wrote: >>>>> >>>>> On Wed, Jan 14, 2009 at 6:00 PM, Liav Ezer >>>>> wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>>> I have the following problem: >>>>>> >>>>>> In my Camel DSL routing logic i call a processor which analyzes my >>>>>> exchange. >>>>>> >>>>>> When i looked at the Exchange API i saw that i can extract the >>>>>> original >>>>>> exchane's end-point. >>>>>> >>>>>> Please refer to: >>>>>> http://activemq.apache.org/camel/maven/camel-core/apidocs/org/apache/camel/Exchange.html#getFromEndpoint() >>>>>> >>>>>> But this API is new - only in camel-2.0 while SMX works with 1.5 at >>>>>> most. >>>>>> >>>>>> My questions are: >>>>>> >>>>>> 1. Can you advise how to get the camel-core 2.0 version via maven? >>>>>> >>>>>> I tried the following depedency & got this error: >>>>>> >>>>>> org.apache.camel >>>>>> camel-core >>>>>> 2.0.0 >>>>>> >>>>>> Error: >>>>>> [INFO] >>>>>> ------------------------------------------------------------------- >>>>>> [ERROR] BUILD ERROR >>>>>> [INFO] >>>>>> ------------------------------------------------------------------- >>>>>> [INFO] Failed to resolve artifact. >>>>>> >>>>>> GroupId: org.apache.camel >>>>>> ArtifactId: camel-maven-plugin >>>>>> Version: 2.0.0 >>>>>> >>>>>> Reason: Unable to download the artifact from any repository >>>>>> org.apache.camel:camel-maven-plugin:pom:2.0.0 >>>>>> >>>>>> from the specified remote repositories: >>>>>> central (http://repo1.maven.org/maven2), >>>>>> apache.snapshots >>>>>> (http://people.apache.org/repo/m2-snapshot-repository), >>>>>> apache (http://people.apache.org/repo/m2-ibiblio-rsync-repository) >>>>> See the download page for using SNAPSHOTS >>>>> http://activemq.apache.org/camel/download.html >>>>> >>>>> You need to add a SNAPSHOT maven repo and use 2.0-SNAPSHOT as version >>>>> >>>>> >>>>> >>>>>> >>>>>> >>>>>> 2. Can you please advise how to gain the exchange's 'from' end-point >>>>>> at >>>>>> run >>>>>> time in other way beside using this new API? >>>>> I dont think it is that easy in 1.x. An interceptor might get you >>>>> close (like the tracer) as you can get the node (the model of the >>>>> route graph) that started it and then "compute" the from endpoint. >>>>> >>>>> What is your use case since you need the from endpoint? >>>>> >>>>>> >>>>>> Thanks. >>>>>> >>>>>> -- >>>>>> View this message in context: >>>>>> http://www.nabble.com/Problem-using-camel-2.0-API-in-SMX-tp21460207s22882p21460207.html >>>>>> Sent from the Camel - Users mailing list archive at Nabble.com. >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> /Claus Ibsen >>>>> Apache Camel Committer >>>>> Blog: http://davsclaus.blogspot.com/ >>>>> >>>>> >>>> >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/Problem-using-camel-2.0-API-in-SMX-tp21460207s22882p21472159.html >>>> Sent from the Camel - Users mailing list archive at Nabble.com. >>>> >>>> >>> >>> >>> >>> -- >>> >>> /Claus Ibsen >>> Apache Camel Committer >>> Blog: http://davsclaus.blogspot.com/ >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Problem-using-camel-2.0-API-in-SMX-tp21460207s22882p21473876.html Sent from the Camel - Users mailing list archive at Nabble.com.