On Sat, Sep 5, 2009 at 3:01 PM, Chris Audley<[email protected]> wrote: > > Thanks for the quick answer. I had removed my processor for the example in > my question, but my processor is InOut as well, so the same issue applies. I > hadn't understood the roll of the mock uris. > > So Camel ignores routes that don't end in a producer. How complete is this > check? If I create something like the following: > > <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> > <route> > <from uri="direct:start"/> > <multicast> > <to uri="mock:result"/> > <unmarshall/> > </multicast> > </route> > </camelContext> > > Will camel detect that the unmarshall doesn't lead to a producer and ignore > the entire route, or will it allow it because of the <to/> producer? >
No as Camel provides a real DSL underneath for routing that allows you to build routes in lego style. As there are 50+ operations then there are many combinations. And what if there was a mistake in the detection then the possible was suddenly impossible. For such checks it would be IMHO better if tooling could "babysit" engineers. For example: http://fusesource.com/products/fuse-integration-designer/ PS: Your case is in fact possible as if you are doing InOut routing then the reply to the client would be the unmarshalled payload. PPS: Each operation should of course be able to validate that its configured properly so unmarshal so state which data format you should use etc. > -----Original Message----- > From: Mick Knutson [mailto:[email protected]] > Sent: Sat 9/5/2009 2:50 AM > To: [email protected] > Subject: Re: Can't get simple test to work > > I would suggest you look at the Camel Mock page: > http://camel.apache.org/mock.html > > try something like: > > <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> > > <route> > <from uri="seda:start"/> > <to uri="mock:result"/> > > </route> > </camelContext> > > from: > http://camel.apache.org/spring.html > > > Basically, you created a direct starting point, but that goes nowhere. By > adding a mock, the mock will now consume the messages from the seda:start, > then you can measure and test if the mock gets what you expect. > > > --- > Thank You. > > Mick Knutson, President > > BASE Logic, Inc. > Enterprise Architecture, Design, Mentoring & Agile Consulting > p. (866) BLiNC-411: (254-6241-1) > f. (415) 685-4233 > > Website: http://baselogic.com > Linked IN: http://linkedin.com/in/mickknutson > Vacation Rental: http://tahoe.baselogic.com > --- > > > > On Fri, Sep 4, 2009 at 7:18 PM, Chris Audley > <[email protected]>wrote: > >> I'm trying to setup a simple test route so I can start testing some >> Processors I've written. >> >> In spring, I create a very simple context >> >> <camelContext id="camel" >> xmlns="http://camel.apache.org/schema/spring"> >> <route> >> <from uri="direct:testing"/> >> </route> >> </camelContext> >> >> I inject this context into another bean and later that bean runs some >> code to send a message to the route >> >> ProducerTemplate template = >> camelContext.createProducerTemplate(); >> tempate.sendBody("direct:testing", "testing"); >> >> When I run the sendBody line, I get this message in the log >> >> Sep 4, 2009 10:11:56 PM org.apache.camel.component.direct.DirectProducer >> process >> WARNING: No consumers available on endpoint: Endpoint[direct://testing] >> to process: Exchange[Message: [...@de8aa5] >> >> I'm using Camel 2.0.0 with Spring 2.5.6. I resorted to this test setup >> because I wasn't getting anywhere with uri="file:..." based routes. >> What the hell am I missing? I can't believe something this simple >> doesn't work. >> > > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
