{"id":21322062,"url":"https://github.com/advantageous/lokate-mesos","last_synced_at":"2025-03-15T22:44:51.835Z","repository":{"id":57737511,"uuid":"66106505","full_name":"advantageous/lokate-mesos","owner":"advantageous","description":"Uses Reakt Lokate Lib but add support for querying Mesos/Marathon location. ","archived":false,"fork":false,"pushed_at":"2016-08-23T18:20:30.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T11:47:57.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/advantageous.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-19T19:14:52.000Z","updated_at":"2016-08-20T01:12:48.000Z","dependencies_parsed_at":"2022-08-24T10:52:14.722Z","dependency_job_id":null,"html_url":"https://github.com/advantageous/lokate-mesos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Flokate-mesos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Flokate-mesos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Flokate-mesos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Flokate-mesos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/advantageous","download_url":"https://codeload.github.com/advantageous/lokate-mesos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801612,"owners_count":20350106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T20:13:01.457Z","updated_at":"2025-03-15T22:44:51.770Z","avatar_url":"https://github.com/advantageous.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lokate-mesos\nUses Reakt [Lokate Lib](https://github.com/advantageous/lokate) but adds support for querying [Mesos/Marathon](https://github.com/advantageous/lokate-mesos/wiki/Design-notes-on-using-the-Marathon-REST-API-to-do-discovery) location. \n\n\n## Search by container port\n```\n# Default host\ndiscovery:marathon:///eventbus.sample-dcos3?containerPort=8081 \n# Specify host\ndiscovery:marathon://marathon.mesos:8080/eventbus.sample-dcos3?containerPort=8081\n```\n\n## Search by port name\n```\n# Default host\ndiscovery:marathon:///eventbus.sample-dcos3?portName=eventbus\n# Specify host\ndiscovery:marathon://marathon.mesos:8080/eventbus.sample-dcos3?portName=eventbus\n```\n\n\n## Search by port index\n```\n# Default host\ndiscovery:marathon:///eventbus.sample-dcos3?portIndex=0\n# Specify host\ndiscovery:marathon://marathon.mesos:8080/eventbus.sample-dcos3?portIndex=0\n```\n\n\n## Config URL\n```java\nURI.create(\"marathon://marathon.mesos:8080/\")\n```\n\nSee [Lokate](https://github.com/advantageous/lokate) for more sample usage. \n\n\n## Example\n\n####Gradle file\n```\n\n    //Service discovery\n    compile 'io.advantageous.discovery:lokate-mesos:1.1.5'\n```\n\n\n#### Create discovery service that talks to mesos\n```java\n@RequestMapping(\"/todo-service\")\npublic class TodoServiceImpl implements TodoService {\n\n    ...\n    private final DiscoveryService discoveryService;\n    \n\n    public TodoServiceImpl(ServiceManagementBundle mgmt, TodoRepo todoRepo) {\n         ...\n        logger.info(\"Creating discovery service\");\n        discoveryService = DiscoveryService.create(URI.create(\"marathon://marathon.mesos:8080/\"));\n\n\n        logger.info(\"Todo service created\");\n    }\n```\n\n\n#### Use it\n```java\n\n...\n    @POST(value = \"/service\")\n    public final Promise\u003cList\u003cURI\u003e\u003e listServices(URI uri) {\n        logger.debug(\"List services\");\n        return discoveryService.lookupService(uri);\n    }\n```\n\n\n#### Hit it from REST\n\n```sh\n$  curl -X POST http://public-slave:10101/v1/todo-service/service   -d '\"discovery:marathon:///sample-dcos3?portIndex=0\"' -H \"Content-type: application/json\" | jq .\n[\n  \"service://10.16.204.94:2838\",\n  \"service://10.16.204.95:26078\",\n  \"service://10.16.204.95:23568\"\n]\n\n```\n\nLokate uses [Reakt](http://advantageous.github.io/reakt/) for its async promises.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Flokate-mesos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadvantageous%2Flokate-mesos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Flokate-mesos/lists"}