...
Code Block |
---|
|
<route>
<from uri="file://inbox"/>
<script>
<groovy><![CDATA[ some groovy script here that can be multiple lines and whatnot ]]></groovy>
</script>
<beanRef ref="myServiceBean" method="processLine"/>
</route>
<bean id="myServiceBean" class="com.mycompany.MyServiceBean"/> |
Using external script files
You can refer to external script files instead of inlining the script. For example to load a groovy script from the classpath you need to prefix the value with resource: as shown:
Code Block |
---|
|
<route>
<from uri="file://inbox"/>
<script>
<groovy>resource:classpath:com/foo/myscript.groovy</groovy>
</script>
<beanRef ref="myServiceBean" method="processLine"/>
</route>
<bean id="myServiceBean" class="com.mycompany.MyServiceBean"/> |
You can also refer to the script from the file system with file: instead of classpath: such as file:/var/myscript.groovy
Include Page |
---|
| Using This Pattern |
---|
| Using This Pattern |
---|
|