{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka-management/issues/136","repository_url":"https://api.github.com/repos/akka/akka-management","labels_url":"https://api.github.com/repos/akka/akka-management/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka-management/issues/136/comments","events_url":"https://api.github.com/repos/akka/akka-management/issues/136/events","html_url":"https://github.com/akka/akka-management/issues/136","id":297785725,"number":136,"title":"Add support for DNS SRV","user":{"login":"pocman","id":1695808,"avatar_url":"https://avatars1.githubusercontent.com/u/1695808?v=4","gravatar_id":"","url":"https://api.github.com/users/pocman","html_url":"https://github.com/pocman","followers_url":"https://api.github.com/users/pocman/followers","following_url":"https://api.github.com/users/pocman/following{/other_user}","gists_url":"https://api.github.com/users/pocman/gists{/gist_id}","starred_url":"https://api.github.com/users/pocman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pocman/subscriptions","organizations_url":"https://api.github.com/users/pocman/orgs","repos_url":"https://api.github.com/users/pocman/repos","events_url":"https://api.github.com/users/pocman/events{/privacy}","received_events_url":"https://api.github.com/users/pocman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-16T13:31:34Z","updated_at":"2018-02-21T05:02:22Z","closed_at":null,"author_association":"NONE","body":"I'm trying to use Akka Cluster Bootstrap in replacement for ConstructR-consul with akka-dns in my Lagom project.\r\n\r\nCurrently DNS SRV is not supported but I implemented the following to solve this issue : \r\n```scala\r\npackage akka.discovery.dns\r\n\r\nimport akka.actor.ActorSystem\r\nimport akka.discovery._\r\nimport akka.event.Logging\r\nimport akka.pattern.ask\r\nimport com.lightbend.dns.locator.{ServiceLocator => ServiceLocatorService}\r\n\r\nimport scala.concurrent.Future\r\nimport scala.concurrent.duration.FiniteDuration\r\n\r\n/**\r\n * Looks for DNS SRV records for a given service.\r\n */\r\nclass DnsSrvServiceDiscovery(system: ActorSystem) extends SimpleServiceDiscovery {\r\n\r\n  import SimpleServiceDiscovery._\r\n\r\n  private val log = Logging(system, getClass)\r\n  private val dns = system.actorOf(ServiceLocatorService.props, ServiceLocatorService.Name)\r\n\r\n  import system.dispatcher\r\n\r\n  override def lookup(name: String, resolveTimeout: FiniteDuration): Future[Resolved] =\r\n    dns\r\n        .ask(ServiceLocatorService.GetAddress(name))(resolveTimeout)\r\n        .mapTo[ServiceLocatorService.Addresses]\r\n        .map {\r\n          case ServiceLocatorService.Addresses(addresses) =>\r\n            log.info(\"Resolved Dns.Resolved: {}\", addresses)\r\n            addresses.map(sa => ResolvedTarget(sa.host, Some(sa.port))).to[collection.immutable.Seq]\r\n        }.map(Resolved(name, _))\r\n}\r\n```\r\n\r\nAnd modified the application.conf as follow :\r\n\r\n```yaml\r\nakka {\r\n  discovery {\r\n    method = akka-dns\r\n\r\n    akka-dns {\r\n      # currently no special configuration is present for this module\r\n      class = akka.discovery.dns.DnsSrvServiceDiscovery\r\n    }\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/akka/akka-management/issues/comments/367214389","html_url":"https://github.com/akka/akka-management/issues/136#issuecomment-367214389","issue_url":"https://api.github.com/repos/akka/akka-management/issues/136","id":367214389,"user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars1.githubusercontent.com/u/120979?v=4","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"created_at":"2018-02-21T05:02:22Z","updated_at":"2018-02-21T05:02:22Z","author_association":"OWNER","body":"Thanks! The issue about SRV is here: https://github.com/akka/akka-management/issues/72\r\n\r\nWe want to implement it natively, and then consolidate the other service locator API with this one, splitting out akka-discovery as it's own thing.\r\n\r\n"}}
{"actor":{"display_login":"ktoso"}}