Skip to content

Commit

Permalink
streamCache and trace config options added
Browse files Browse the repository at this point in the history
  • Loading branch information
Arsen A. Gutsal committed Oct 2, 2013
1 parent 3480ee8 commit bc5c728
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions RoutingGrailsPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.grails.plugins.routing.RouteArtefactHandler
import org.springframework.beans.factory.config.MethodInvokingFactoryBean

class RoutingGrailsPlugin {
def version = '1.2.7'
def version = '1.2.8'
def grailsVersion = '2.0.0 > *'
def loadAfter = ['controllers', 'services']
def artefacts = [new RouteArtefactHandler()]
Expand All @@ -26,6 +26,8 @@ class RoutingGrailsPlugin {
def config = application.config.grails.routing
def camelContextId = config?.camelContextId ?: 'camelContext'
def useMDCLogging = config?.useMDCLogging ?: false
def streamCache = config?.streamCache ?: false
def trace = config?.trace ?: false
def routeClasses = application.routeClasses

initializeRouteBuilderHelpers()
Expand All @@ -51,7 +53,11 @@ class RoutingGrailsPlugin {
// this may cause problems if autostarted camel start invoking routes which calls service/controller
// methods, which use dynamically injected methods
// because doWithDynamicMethods is called after doWithSpring
camel.camelContext(id: camelContextId, useMDCLogging: useMDCLogging, autoStartup: false) {
camel.camelContext(id: camelContextId,
useMDCLogging: useMDCLogging,
autoStartup: false,
streamCache: streamCache,
trace: trace) {
def threadPoolProfileConfig = config?.defaultThreadPoolProfile

camel.threadPoolProfile(
Expand Down Expand Up @@ -80,7 +86,7 @@ class RoutingGrailsPlugin {
}

// otherwise we autostart camelContext here
if (application.config?.autoStartup ?: true) {
if (application.config?.grails.routing.autoStartup ?: true) {
def camelContextId = application.config?.camelContextId ?: 'camelContext'
application.mainContext.getBean(camelContextId).start()
}
Expand Down

0 comments on commit bc5c728

Please sign in to comment.