camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Anstey <jans...@gmail.com>
Subject Re: splitter bean as expression
Date Fri, 30 Jan 2009 16:06:10 GMT
Also, theres some test code here

http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterMethodCallTest.java
http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSplitterMethodCallTest.java
http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/splitterMethodCallTest.xml

On Fri, Jan 30, 2009 at 12:33 PM, James Strachan
<james.strachan@gmail.com>wrote:

> 2009/1/30 mta38 <mtaraud.ext@orange-ftgroup.com>:
> >
> > Hi all,
> > I want to test splitter processor and i have implemented my own Splitter
> > expression in java code:
> >
> > Public class MySplitter extends Expression{
> >
> >        public Object evaluate(Exchange arg0) {
> >                //my code
> >        }
> > }
> >
> > <bean id="mySplitter"
> >
> class="com.francetelecom.apt.orange.camel.expressions.SplitterExpression">
> > <property name="size" value="3"/>
> > </bean>
> >
> >
> > <route>
> >        <from uri="wsadapter" />
> >        <splitter>
> >                <expression>
> >                         <bean ref="mySplitter"/>
> >                </expression>
> >                <to uri="seda:b" />
> >        </splitter>
> > </route>
> >
> > My problem now is to create a route that use a splitter, in an xml config
> > file.
>
> I  think this should work....
>
>
> <route>
>       <from uri="wsadapter" />
>       <splitter>
>                <methodCall bean="mySplitter" method="foo"/>
>                <to uri="seda:b" />
>       </splitter>
> </route>
>
> In camel 2.0 this would look like this
>
> <route>
>       <from uri="wsadapter" />
>       <split>
>               <method bean="mySplitter" method="foo"/>
>               <to uri="seda:b" />
>       </split>
> </route>
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>



-- 
Cheers,
Jon

http://janstey.blogspot.com/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message