Streamlined configuration, transport adapters and FailureInjector

- Transports no longer uses raw ActorRefs as listeners but proper interfaces.
 - Added managementCommand support to Transports
 - Added support for dynamically loadable transport adapters
 - Added throttler/failure injector transport adapter
 - added actor based adapter support
 - Changed configuration method of multiple transports - Fixed tests to work with the new remoting
This commit is contained in:
Endre Sándor Varga 2012-11-23 10:15:19 +01:00
parent 5b96c28acd
commit 0705d47a88
30 changed files with 1812 additions and 585 deletions

View file

@ -34,31 +34,6 @@ object RemotingSpec {
}
val cfg: Config = ConfigFactory parseString ("""
common-transport-settings {
log-transport-events = true
connection-timeout = 120s
use-dispatcher-for-io = ""
write-buffer-high-water-mark = 0b
write-buffer-low-water-mark = 0b
send-buffer-size = 32000b
receive-buffer-size = 32000b
backlog = 4096
hostname = localhost
enable-ssl = false
server-socket-worker-pool {
pool-size-min = 2
pool-size-factor = 1.0
pool-size-max = 8
}
client-socket-worker-pool {
pool-size-min = 2
pool-size-factor = 1.0
pool-size-max = 8
}
}
common-ssl-settings {
key-store = "%s"
trust-store = "%s"
@ -76,44 +51,21 @@ object RemotingSpec {
remoting.retry-latch-closed-for = 1 s
remoting.log-remote-lifecycle-events = on
remoting.enabled-transports = [test, tcp, udp, ssl]
remoting.transports = [
{
remoting.transports.tcp.port = 12345
remoting.transports.udp.port = 12345
remoting.transports.ssl.port = 23456
remoting.transports.ssl.ssl = ${common-ssl-settings}
remoting.transports.test {
transport-class = "akka.remote.transport.TestTransport"
settings {
registry-key = aX33k0jWKg
local-address = "test://RemotingSpec@localhost:12345"
maximum-payload-bytes = 32000 bytes
scheme-identifier = test
}
},
{
transport-class = "akka.remote.transport.netty.NettyTransport"
settings = ${common-transport-settings}
settings {
transport-protocol = tcp
port = 12345
}
},
{
transport-class = "akka.remote.transport.netty.NettyTransport"
settings = ${common-transport-settings}
settings {
transport-protocol = udp
port = 12345
}
},
{
transport-class = "akka.remote.transport.netty.NettyTransport"
settings = ${common-transport-settings}
settings {
transport-protocol = tcp
enable-ssl = true
port = 23456
ssl = ${common-ssl-settings}
}
}
]
applied-adapters = []
registry-key = aX33k0jWKg
local-address = "test://RemotingSpec@localhost:12345"
maximum-payload-bytes = 32000 bytes
scheme-identifier = test
}
actor.deployment {
/blub.remote = "test.akka://remote-sys@localhost:12346"
@ -137,44 +89,12 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D
val conf = ConfigFactory.parseString(
"""
akka.remote.netty.port=12346
akka.remoting.transports = [
{
transport-class = "akka.remote.transport.TestTransport"
settings {
registry-key = aX33k0jWKg
local-address = "test://remote-sys@localhost:12346"
maximum-payload-bytes = 32000 bytes
scheme-identifier = test
}
},
{
transport-class = "akka.remote.transport.netty.NettyTransport"
settings = ${common-transport-settings}
settings {
transport-protocol = tcp
port = 12346
}
},
{
transport-class = "akka.remote.transport.netty.NettyTransport"
settings = ${common-transport-settings}
settings {
transport-protocol = udp
port = 12346
}
},
{
transport-class = "akka.remote.transport.netty.NettyTransport"
settings = ${common-transport-settings}
settings {
transport-protocol = tcp
enable-ssl = true
port = 23457
ssl = ${common-ssl-settings}
}
}
]
akka.remoting.transports {
tcp.port = 12346
udp.port = 12346
ssl.port = 23457
test.local-address = "test://remote-sys@localhost:12346"
}
""").withFallback(system.settings.config).resolve()
val other = ActorSystem("remote-sys", conf)
@ -195,12 +115,11 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D
"support remote look-ups" in {
here ! "ping"
expectMsg("pong")
lastSender must be(testActor)
expectMsg(("pong", testActor))
}
"send error message for wrong address" in {
EventFilter.error(start = "AssociationError", occurrences = 1).intercept {
EventFilter.error(start = "AssociationError").intercept {
system.actorFor("test.akka://nonexistingsystem@localhost:12346/user/echo") ! "ping"
}
}