#2375 - disable JMX for Camel by default, add configuration setting for it. Also add docs to the settings and harmonize Camel settings to Akka standard.
This commit is contained in:
parent
a322b212e3
commit
8fe47fa291
3 changed files with 28 additions and 8 deletions
|
|
@ -7,10 +7,22 @@
|
||||||
|
|
||||||
akka {
|
akka {
|
||||||
camel {
|
camel {
|
||||||
|
# Whether JMX should be enabled or disabled for the Camel Context
|
||||||
|
jmx = off
|
||||||
|
|
||||||
consumer {
|
consumer {
|
||||||
autoAck = true
|
# Configured setting which determines whether one-way communications between an endpoint and this consumer actor
|
||||||
replyTimeout = 1m
|
# should be auto-acknowledged or application-acknowledged.
|
||||||
activationTimeout = 10s
|
# 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,23 +43,30 @@ trait Camel extends ConsumerRegistry with ProducerRegistry with Extension with A
|
||||||
* Settings for the Camel Extension
|
* Settings for the Camel Extension
|
||||||
* @param config the config
|
* @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.
|
* 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.
|
* 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.
|
* 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
|
* Configured setting which determines whether one-way communications between an endpoint and this consumer actor
|
||||||
* should be auto-acknowledged or application-acknowledged.
|
* should be auto-acknowledged or application-acknowledged.
|
||||||
* This flag has only effect when exchange is in-only.
|
* 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")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ private[camel] class DefaultCamel(val system: ActorSystem) extends Camel {
|
||||||
|
|
||||||
lazy val context: CamelContext = {
|
lazy val context: CamelContext = {
|
||||||
val ctx = new DefaultCamelContext
|
val ctx = new DefaultCamelContext
|
||||||
|
if (!settings.jmxStatistics) ctx.disableJMX()
|
||||||
ctx.setName(system.name)
|
ctx.setName(system.name)
|
||||||
ctx.setStreamCaching(true)
|
ctx.setStreamCaching(true)
|
||||||
ctx.addComponent("akka", new ActorComponent(this, system))
|
ctx.addComponent("akka", new ActorComponent(this, system))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue