add docs for durMbx settings, see #1863

This commit is contained in:
Roland 2012-03-05 17:48:38 +01:00
parent 56ce7a0ecd
commit 3699c6856e
8 changed files with 54 additions and 7 deletions

View file

@ -4,16 +4,30 @@
# This is the reference config file that contains all the default settings. # This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf. # Make your edits/overrides in your application.conf.
#
# for more information see <https://github.com/kr/beanstalkd/blob/v1.3/doc/protocol.txt>
akka { akka {
actor { actor {
mailbox { mailbox {
beanstalk { beanstalk {
# hostname to connect to
hostname = "127.0.0.1" hostname = "127.0.0.1"
# port to connect to
port = 11300 port = 11300
# wait period in case of a connection failure before reconnect
reconnect-window = 5s reconnect-window = 5s
# integer number of seconds to wait before putting the job in
# the ready queue. The job will be in the "delayed" state during this time.
message-submit-delay = 0s message-submit-delay = 0s
message-submit-timeout = 5s
# time to run -- is an integer number of seconds to allow a worker
# to run this job. This time is counted from the moment a worker reserves
# this job. If the worker does not delete, release, or bury the job within
# <ttr> seconds, the job will time out and the server will release the job.
message-time-to-live = 120s message-time-to-live = 120s
} }
} }

View file

@ -41,7 +41,7 @@ class BeanstalkBasedMessageQueue(_owner: ActorContext, val settings: BeanstalkMa
// ===== For MessageQueue ===== // ===== For MessageQueue =====
def enqueue(receiver: ActorRef, envelope: Envelope) { def enqueue(receiver: ActorRef, envelope: Envelope) {
Some(queue.get.put(65536, messageSubmitDelaySeconds, messageTimeToLiveSeconds, serialize(envelope)).toInt) queue.get.put(65536, messageSubmitDelaySeconds, messageTimeToLiveSeconds, serialize(envelope)).toInt
} }
def dequeue(): Envelope = try { def dequeue(): Envelope = try {

View file

@ -21,7 +21,6 @@ class BeanstalkMailboxSettings(val systemSettings: ActorSystem.Settings, val use
val Port = getInt("port") val Port = getInt("port")
val ReconnectWindow = Duration(getMilliseconds("reconnect-window"), MILLISECONDS) val ReconnectWindow = Duration(getMilliseconds("reconnect-window"), MILLISECONDS)
val MessageSubmitDelay = Duration(getMilliseconds("message-submit-delay"), MILLISECONDS) val MessageSubmitDelay = Duration(getMilliseconds("message-submit-delay"), MILLISECONDS)
val MessageSubmitTimeout = Duration(getMilliseconds("message-submit-timeout"), MILLISECONDS)
val MessageTimeToLive = Duration(getMilliseconds("message-time-to-live"), MILLISECONDS) val MessageTimeToLive = Duration(getMilliseconds("message-time-to-live"), MILLISECONDS)
} }

View file

@ -4,23 +4,47 @@
# This is the reference config file that contains all the default settings. # This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf. # Make your edits/overrides in your application.conf.
#
# For more information see <https://github.com/robey/kestrel/>
akka { akka {
actor { actor {
mailbox { mailbox {
file-based { file-based {
# directory below which this queue resides
directory-path = "./_mb" directory-path = "./_mb"
# attempting to add an item after the queue reaches this size (in items) will fail.
max-items = 2147483647 max-items = 2147483647
# attempting to add an item after the queue reaches this size (in bytes) will fail.
max-size = 2147483647 bytes max-size = 2147483647 bytes
max-items = 2147483647
# attempting to add an item larger than this size (in bytes) will fail.
max-item-size = 2147483647 bytes max-item-size = 2147483647 bytes
# maximum expiration time for this queue (seconds).
max-age = 0s max-age = 0s
# maximum journal size before the journal should be rotated.
max-journal-size = 16 MiB max-journal-size = 16 MiB
# maximum size of a queue before it drops into read-behind mode.
max-memory-size = 128 MiB max-memory-size = 128 MiB
# maximum overflow (multiplier) of a journal file before we re-create it.
max-journal-overflow = 10 max-journal-overflow = 10
# absolute maximum size of a journal file until we rebuild it, no matter what.
max-journal-size-absolute = 9223372036854775807 bytes max-journal-size-absolute = 9223372036854775807 bytes
# whether to drop older items (instead of newer) when the queue is full
discard-old-when-full = on discard-old-when-full = on
# whether to keep a journal file at all
keep-journal = on keep-journal = on
# whether to sync the journal after each transaction
sync-journal = off sync-journal = off
} }
} }

View file

@ -4,12 +4,17 @@
# This is the reference config file that contains all the default settings. # This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf. # Make your edits/overrides in your application.conf.
#
# for more information see <http://redis.io/>
akka { akka {
actor { actor {
mailbox { mailbox {
redis { redis {
# hostname of where the redis queue resides
hostname = "127.0.0.1" hostname = "127.0.0.1"
# port at which the redis queue resides
port = 6379 port = 6379
} }
} }

View file

@ -4,15 +4,21 @@
# This is the reference config file that contains all the default settings. # This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf. # Make your edits/overrides in your application.conf.
#
# For more information see <http://wiki.apache.org/hadoop/ZooKeeper>
akka { akka {
actor { actor {
mailbox { mailbox {
zookeeper { zookeeper {
# host and port to connect to ZooKeeper
server-addresses = "127.0.0.1:2181" server-addresses = "127.0.0.1:2181"
# timeout after which an unreachable client is considered dead and its session is closed
session-timeout = 60s session-timeout = 60s
# maximum wait period while connecting to ZooKeeper service
connection-timeout = 60s connection-timeout = 60s
blocking-queue = on
} }
} }
} }

View file

@ -38,7 +38,7 @@ class ZooKeeperBasedMessageQueue(_owner: ActorContext, val settings: ZooKeeperBa
settings.ZkServerAddresses, settings.ZkServerAddresses,
settings.SessionTimeout, settings.SessionTimeout,
settings.ConnectionTimeout) settings.ConnectionTimeout)
private val queue = new ZooKeeperQueue[Array[Byte]](zkClient, queuePathTemplate.format(name), settings.BlockingQueue) private val queue = new ZooKeeperQueue[Array[Byte]](zkClient, queuePathTemplate.format(name), true)
def enqueue(receiver: ActorRef, envelope: Envelope) { def enqueue(receiver: ActorRef, envelope: Envelope) {
queue.enqueue(serialize(envelope)) queue.enqueue(serialize(envelope))

View file

@ -20,6 +20,5 @@ class ZooKeeperBasedMailboxSettings(val systemSettings: ActorSystem.Settings, va
val ZkServerAddresses = getString("server-addresses") val ZkServerAddresses = getString("server-addresses")
val SessionTimeout = Duration(getMilliseconds("session-timeout"), MILLISECONDS) val SessionTimeout = Duration(getMilliseconds("session-timeout"), MILLISECONDS)
val ConnectionTimeout = Duration(getMilliseconds("connection-timeout"), MILLISECONDS) val ConnectionTimeout = Duration(getMilliseconds("connection-timeout"), MILLISECONDS)
val BlockingQueue = getBoolean("blocking-queue")
} }