camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bocamel <>
Subject @BeanInject ignored in Groovy when called as a script
Date Tue, 05 May 2015 12:59:53 GMT
Because groovy script called by Camel cannot be debugged under IDE, I created
my script as a hybrid so I can easily switch it between the bean mode and
script mode:
class GroovyProc4 {
	MyConfig myConfig
	public void process(Exchange exchange) {

def GroovyProc4 mybean = new GroovyProc4()
//mybean.myConfig = MyConfig.getInstanceFromRegistry(exchange.context,

In the following route, I can choose to run the above processor as a script
or bean.
    <camel:route autoStartup="true">
        <camel:from uri="timer://test?period=10s"/>
         <camel:to uri="bean:groovyProc4" />

But when I ran it as a script, the @BeanInject in the class was ignored and
I would have to explicitly initialize the member property myConfig by
retrieving the value from Registry (in the commented out statement in the
script above).  Is this the expected behavior?   Thanks for any help!

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message