camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: what's correct configuration of spliter pattern.
Date Tue, 20 Mar 2012 08:10:36 GMT
On Tue, Mar 20, 2012 at 9:02 AM, Willem Jiang <willem.jiang@gmail.com> wrote:
> Can you move the "to" tag out of the split like this ?
>
>  <split>
>      <method ref="splitter" method="split"/>
>  </split>
>
>  <to uri="jbi:service:http://cobweb.hongbo.net.cn/default/master/router" />
>

No that is wrong, the should be outputs inside the <split> tag.
Like some of the samples here: http://camel.apache.org/splitter



> Willem
>
> On Mon Mar 19 16:13:13 2012, wow wrote:
>>
>> I use spliter to split a message, camel-context.xml as following:
>>
>> <beans .......>
>>     <bean id="splitter"
>> class="com.hongbo.cobweb.master.split.SplitterMsgByConsumer" />
>>
>>     <camelContext id="camelContext"
>> xmlns="http://camel.apache.org/schema/spring">
>>         <route>
>>             <from
>> uri="jbi:service:http://cobweb.hongbo.net.cn/default/master/camel?mep=in-out"
>> />
>>             <split>
>>                                <method ref="splitter" method="split"/>
>>                                <to
>> uri="jbi:service:http://cobweb.hongbo.net.cn/default/master/router" />
>>                        </split>
>>        <recipientList delimiter=",">
>>        <header>CW_MSG_DESTINATION_ENDPOINT_URI</header>
>>        </recipientList>
>>         </route>
>>     </camelContext>
>> </beans>
>>
>> when camel parse the route ,a exception is throwen:
>> Caused by: java.lang.IllegalArgumentException: Definition has no children
>> on Split[bean{splitter, method=split} ->  []]
>>        at
>> org.apache.camel.model.ProcessorDefinition.createChildProcessor(ProcessorDefinition.java:157)
>>        at
>> org.apache.camel.model.SplitDefinition.createProcessor(SplitDefinition.java:95)
>>        at
>> org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:437)
>>        at
>> org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:183)
>>        at
>> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:791)
>>        ... 47 more
>>
>>
>> "to" tag already exist in "split" tag, what does mean the exception?
>>
>>                                                      
          thank you.
>>
>>
>
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>        http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang Weibo: willemjiang



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message