Parse service names with special characters in them #30672
This commit is contained in:
parent
e22152098e
commit
8187afebe9
2 changed files with 8 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ package akka.discovery.config
|
|||
import scala.concurrent.Future
|
||||
import scala.concurrent.duration.FiniteDuration
|
||||
|
||||
import com.typesafe.config.Config
|
||||
import com.typesafe.config.{ Config, ConfigUtil }
|
||||
|
||||
import akka.actor.ExtendedActorSystem
|
||||
import akka.annotation.InternalApi
|
||||
|
|
@ -27,7 +27,7 @@ private object ConfigServicesParser {
|
|||
.entrySet()
|
||||
.asScala
|
||||
.map { en =>
|
||||
(en.getKey, config.getConfig(en.getKey))
|
||||
(en.getKey, config.getConfig(ConfigUtil.quoteString(en.getKey)))
|
||||
}
|
||||
.toMap
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ akka {
|
|||
}
|
||||
]
|
||||
},
|
||||
service2 = {
|
||||
"service2.domain.com" = {
|
||||
endpoints = []
|
||||
}
|
||||
}
|
||||
|
|
@ -70,7 +70,11 @@ class ConfigServiceDiscoverySpec
|
|||
ResolvedTarget(host = "cat", port = Some(1233), address = None),
|
||||
ResolvedTarget(host = "dog", port = None, address = None))
|
||||
}
|
||||
|
||||
"return no resolved targets if no endpoints" in {
|
||||
val result = discovery.lookup("service2.domain.com", 100.millis).futureValue
|
||||
result.serviceName shouldEqual "service2.domain.com"
|
||||
result.addresses shouldEqual immutable.Seq.empty
|
||||
}
|
||||
"return no resolved targets if not in config" in {
|
||||
val result = discovery.lookup("dontexist", 100.millis).futureValue
|
||||
result.serviceName shouldEqual "dontexist"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue