Created
November 25, 2011 23:49
-
-
Save uarun/1394695 to your computer and use it in GitHub Desktop.
BeanBuilder definition to scan (spring) container context for Camel Routes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.camel.CamelContext | |
import org.apache.camel.processor.interceptor.DefaultTraceFormatter | |
import org.apache.camel.processor.interceptor.Tracer | |
beans { | |
def config = application.config | |
xmlns camel: "http://camel.apache.org/schema/spring" | |
xmlns context: "http://www.springframework.org/schema/context" | |
camelTracer(Tracer) { | |
traceOutExchanges = true | |
logLevel = 'INFO' | |
} | |
traceFormatter(DefaultTraceFormatter) { | |
breadCrumbLength = 0 | |
nodeLength = 0 | |
showBreadCrumb = true | |
showNode = true | |
showProperties = true | |
showHeaders = true | |
showExchangePattern = true | |
showException = true | |
showBody = true | |
showBodyType = true | |
} | |
//... This will enable Spring to pickup classes with @Component annotation | |
context.'component-scan'('base-package': 'com.arun.routes') | |
//... The above could also be done by setting - grails.spring.bean.packages = ['...'] | |
//... But we like this better since its nicely externalized | |
camel.camelContext(id: 'camelContext') { | |
camel.contextScan {} //... Camel now scans the context for Routebuilder instances | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beans = { | |
importBeans 'file:conf/spring/camel-beans.groovy' | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think we need to specify "package spring" in camel-beans.groovy to run it, Please correct me if I am wrong, I faced this issue.