diff --git a/akka-camel/src/main/resources/reference.conf b/akka-camel/src/main/resources/reference.conf index 658c729fb3..76be54088d 100644 --- a/akka-camel/src/main/resources/reference.conf +++ b/akka-camel/src/main/resources/reference.conf @@ -7,10 +7,22 @@ akka { camel { + # Whether JMX should be enabled or disabled for the Camel Context + jmx = off + consumer { - autoAck = true - replyTimeout = 1m - activationTimeout = 10s + # Configured setting which determines whether one-way communications between an endpoint and this consumer actor + # should be auto-acknowledged or application-acknowledged. + # This flag has only effect when exchange is in-only. + auto-ack = on + + # When endpoint is out-capable (can produce responses) reply-timeout is the maximum time + # the endpoint can take to send the response before the message exchange fails. + # This setting is used for out-capable, in-only, manually acknowledged communication. + reply-timeout = 1m + + # The duration of time to await activation of an endpoint. + activation-timeout = 10s } } } diff --git a/akka-camel/src/main/scala/akka/camel/Camel.scala b/akka-camel/src/main/scala/akka/camel/Camel.scala index 0ba241590b..7981d091bd 100644 --- a/akka-camel/src/main/scala/akka/camel/Camel.scala +++ b/akka-camel/src/main/scala/akka/camel/Camel.scala @@ -43,23 +43,30 @@ trait Camel extends ConsumerRegistry with ProducerRegistry with Extension with A * Settings for the Camel Extension * @param config the config */ -class CamelSettings(val config: Config) { +class CamelSettings private[camel] (config: Config) { /** * Configured setting for how long the actor should wait for activation before it fails. */ - final val activationTimeout: Duration = Duration(config.getMilliseconds("akka.camel.consumer.activationTimeout"), MILLISECONDS) + final val activationTimeout: Duration = Duration(config.getMilliseconds("akka.camel.consumer.activation-timeout"), MILLISECONDS) + /** - * Configured setting, When endpoint is out-capable (can produce responses) replyTimeout is the maximum time + * Configured setting, when endpoint is out-capable (can produce responses) replyTimeout is the maximum time * the endpoint can take to send the response before the message exchange fails. * This setting is used for out-capable, in-only, manually acknowledged communication. */ - final val replyTimeout: Duration = Duration(config.getMilliseconds("akka.camel.consumer.replyTimeout"), MILLISECONDS) + final val replyTimeout: Duration = Duration(config.getMilliseconds("akka.camel.consumer.reply-timeout"), MILLISECONDS) + /** * Configured setting which determines whether one-way communications between an endpoint and this consumer actor * should be auto-acknowledged or application-acknowledged. * This flag has only effect when exchange is in-only. */ - final val autoAck: Boolean = config.getBoolean("akka.camel.consumer.autoAck") + final val autoAck: Boolean = config.getBoolean("akka.camel.consumer.auto-ack") + + /** + * + */ + final val jmxStatistics: Boolean = config.getBoolean("akka.camel.jmx") } /** diff --git a/akka-camel/src/main/scala/akka/camel/internal/DefaultCamel.scala b/akka-camel/src/main/scala/akka/camel/internal/DefaultCamel.scala index 59752526f4..df681ba98a 100644 --- a/akka-camel/src/main/scala/akka/camel/internal/DefaultCamel.scala +++ b/akka-camel/src/main/scala/akka/camel/internal/DefaultCamel.scala @@ -28,6 +28,7 @@ private[camel] class DefaultCamel(val system: ActorSystem) extends Camel { lazy val context: CamelContext = { val ctx = new DefaultCamelContext + if (!settings.jmxStatistics) ctx.disableJMX() ctx.setName(system.name) ctx.setStreamCaching(true) ctx.addComponent("akka", new ActorComponent(this, system))