{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka-management/issues/157","repository_url":"https://api.github.com/repos/akka/akka-management","labels_url":"https://api.github.com/repos/akka/akka-management/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka-management/issues/157/comments","events_url":"https://api.github.com/repos/akka/akka-management/issues/157/events","html_url":"https://github.com/akka/akka-management/issues/157","id":310706894,"node_id":"MDU6SXNzdWUzMTA3MDY4OTQ=","number":157,"title":"\"Localhost\" (file?) discovery","user":{"login":"ktoso","id":120979,"node_id":"MDQ6VXNlcjEyMDk3OQ==","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},"labels":[{"id":601806440,"node_id":"MDU6TGFiZWw2MDE4MDY0NDA=","url":"https://api.github.com/repos/akka/akka-management/labels/1%20-%20triaged","name":"1 - triaged","color":"5319e7","default":false},{"id":478201797,"node_id":"MDU6TGFiZWw0NzgyMDE3OTc=","url":"https://api.github.com/repos/akka/akka-management/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true},{"id":892218619,"node_id":"MDU6TGFiZWw4OTIyMTg2MTk=","url":"https://api.github.com/repos/akka/akka-management/labels/t:discovery","name":"t:discovery","color":"cccccc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-03T06:14:43Z","updated_at":"2018-06-02T13:48:31Z","closed_at":null,"author_association":"MEMBER","body":"We could implement a discovery mechanism that works when you're on the same localhost (no containers, etc, just 2 apps started on same box).\r\n\r\nThe discovery mechanism could memory map a specific \"discovery file\" and all nodes would monitor it (for discovery).\r\n"},"comment":{"url":"https://api.github.com/repos/akka/akka-management/issues/comments/394088958","html_url":"https://github.com/akka/akka-management/issues/157#issuecomment-394088958","issue_url":"https://api.github.com/repos/akka/akka-management/issues/157","id":394088958,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDA4ODk1OA==","user":{"login":"mikx","id":1767613,"node_id":"MDQ6VXNlcjE3Njc2MTM=","avatar_url":"https://avatars2.githubusercontent.com/u/1767613?v=4","gravatar_id":"","url":"https://api.github.com/users/mikx","html_url":"https://github.com/mikx","followers_url":"https://api.github.com/users/mikx/followers","following_url":"https://api.github.com/users/mikx/following{/other_user}","gists_url":"https://api.github.com/users/mikx/gists{/gist_id}","starred_url":"https://api.github.com/users/mikx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikx/subscriptions","organizations_url":"https://api.github.com/users/mikx/orgs","repos_url":"https://api.github.com/users/mikx/repos","events_url":"https://api.github.com/users/mikx/events{/privacy}","received_events_url":"https://api.github.com/users/mikx/received_events","type":"User","site_admin":false},"created_at":"2018-06-02T13:48:31Z","updated_at":"2018-06-02T13:48:31Z","author_association":"NONE","body":"That is what I have now:\r\n\r\n```\r\n\takka.discovery.inline {\r\n\t  targets = \"_:19998,_:19999\"\r\n\t  class = akka.discovery.config.InlineSimpleServiceDiscovery\r\n\t}\r\n```\r\n\r\n```\r\nclass InlineSimpleServiceDiscovery(system: ActorSystem) extends SimpleServiceDiscovery {\r\n  override def lookup(name: String, resolveTimeout: FiniteDuration): Future[Resolved] = {\r\n    val targets = system.settings.config.getString(\"akka.discovery.inline.targets\")\r\n    val host = InetAddress.getLocalHost().getHostAddress()\r\n    val resolved = targets.split(',').to[collection.immutable.Seq] map { _.trim().split(':') } map {\r\n      case Array(\"_\", port) => ResolvedTarget(host, Option(port).map(_.toInt))\r\n      case Array(hst, port) => ResolvedTarget(hst,  Option(port).map(_.toInt))\r\n    }\r\n    Future.successful(Resolved(name, resolved))\r\n  }\r\n}\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"mikx"}}