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: separate files are the Spring DSL
Date Sat, 15 Oct 2011 06:31:31 GMT
On Fri, Oct 14, 2011 at 11:28 PM, Mathieu Lalonde <mrlalonde@live.ca> wrote:
>
> I haven't used the Spring DSL much but I think you need to import the other xml file
(or have it loaded separately within the same Spring context) and have ref="ftpToJms" which
is your routeContext id.  THat's how Spring works for regular beans.
>

Yeah see this FAQ
http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html


>
>
> ----------------------------------------
>> Date: Fri, 14 Oct 2011 13:24:49 -0700
>> From: m_essa24@hotmail.com
>> To: dev@camel.apache.org
>> Subject: separate files are the Spring DSL
>>
>> I have an XML file with the following route: (I have tested it and it works
>> fine)
>>
>> <route>
>> <from uri="file:camel/input"/>
>> <choice>
>> <when>
>> <language language="simple">${header.CamelFileName}
>> regex '^.*xml$'</language>
>> <to uri="file:camel/xmlFolder"/>
>> </when>
>> <when>
>> <language language="simple">${header.CamelFileName}
>> regex '^.*(csv|csl)$'</language>
>> <to uri="file:camel/cvsFolder"/>
>> </when>
>> <otherwise>
>> <to uri="file:camel/others"/>
>> <stop/>
>> </otherwise>
>> </choice>
>> </route>
>>
>> Now I want to define the route in a separate XML file using routeContext and
>> access it in the main xml file using routeContextRef. I havee created the
>> route as
>>
>> <routeContext id="ftpToJms"
>> xmlns="http://camel.apache.org/schema/spring">
>> <route>
>> <from uri="file:camel/input"/>
>> <choice>
>> <when>
>> <language language="simple">${header.CamelFileName}
>> regex '^.*xml$'</language>
>> <to uri="file:camel/xmlFolder"/>
>> </when>
>> <when>
>> <language language="simple">${header.CamelFileName}
>> regex '^.*(csv|csl)$'</language>
>> <to uri="file:camel/cvsFolder"/>
>> </when>
>> <otherwise>
>> <to uri="file:camel/others"/>
>> <stop/>
>> </otherwise>
>> </choice>
>> </route>
>> </routeContext>
>>
>> If I save it as ftpToJms.xml then how can I refer to it using
>> routeContextRef?
>>
>> I did follwoing but it is failing:
>>
>> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> <routeContextRef ref="ftpToJms.xml"/>
>> </camelContext>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/separate-files-are-the-Spring-DSL-tp4903855p4903855.html
>> Sent from the Camel Development mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
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