Make MailboxType implementation configurable. See #1484
* Added mailboxType property to dispatcher config * Changed durable mailboxes to use this * Updated docs for durable mailboxes
This commit is contained in:
parent
6e3c2cb682
commit
61813c6635
10 changed files with 183 additions and 119 deletions
|
|
@ -271,11 +271,15 @@ abstract class MessageDispatcherConfigurator() {
|
|||
def configure(config: Config, settings: Settings, prerequisites: DispatcherPrerequisites): MessageDispatcher
|
||||
|
||||
def mailboxType(config: Config, settings: Settings): MailboxType = {
|
||||
val capacity = config.getInt("mailbox-capacity")
|
||||
if (capacity < 1) UnboundedMailbox()
|
||||
else {
|
||||
val duration = Duration(config.getNanoseconds("mailbox-push-timeout-time"), TimeUnit.NANOSECONDS)
|
||||
BoundedMailbox(capacity, duration)
|
||||
config.getString("mailboxType") match {
|
||||
case "" ⇒
|
||||
val capacity = config.getInt("mailbox-capacity")
|
||||
if (capacity < 1) UnboundedMailbox()
|
||||
else {
|
||||
val duration = Duration(config.getNanoseconds("mailbox-push-timeout-time"), TimeUnit.NANOSECONDS)
|
||||
BoundedMailbox(capacity, duration)
|
||||
}
|
||||
case fqn ⇒ new CustomMailboxType(fqn)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue