{"id":20875213,"url":"https://github.com/smallrye/smallrye-stork","last_synced_at":"2025-05-16T04:05:56.153Z","repository":{"id":37081870,"uuid":"360410561","full_name":"smallrye/smallrye-stork","owner":"smallrye","description":"SmallRye Stork is a service discovery and client side-load balancing framework.","archived":false,"fork":false,"pushed_at":"2025-04-30T15:12:12.000Z","size":8781,"stargazers_count":83,"open_issues_count":14,"forks_count":26,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-30T16:25:50.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://smallrye.io/smallrye-stork/","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/smallrye.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-22T06:10:12.000Z","updated_at":"2025-04-30T15:12:18.000Z","dependencies_parsed_at":"2023-12-18T09:28:42.446Z","dependency_job_id":"45058a2f-8783-4bd9-9361-6f1da9012d66","html_url":"https://github.com/smallrye/smallrye-stork","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallrye%2Fsmallrye-stork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallrye%2Fsmallrye-stork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallrye%2Fsmallrye-stork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallrye%2Fsmallrye-stork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smallrye","download_url":"https://codeload.github.com/smallrye/smallrye-stork/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464895,"owners_count":22075570,"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-18T06:43:09.437Z","updated_at":"2025-05-16T04:05:51.143Z","avatar_url":"https://github.com/smallrye.png","language":"Java","funding_links":[],"categories":["容错组件"],"sub_categories":[],"readme":":ci: https://github.com/smallrye/smallrye-stork/actions?query=workflow%3A%22SmallRye+Build%22\n:sonar: https://sonarcloud.io/dashboard?id=smallrye_smallrye-stork\n\n== SmallRye Stork\n\nimage:https://img.shields.io/maven-central/v/io.smallrye.stork/stork-api?color=green[\"Maven\"] image:https://javadoc.io/badge2/io.smallrye.stork/stork-api/javadoc.svg[javadoc]  image:https://img.shields.io/github/license/smallrye/smallrye-stork.svg[\"License\", link=\"http://www.apache.org/licenses/LICENSE-2.0\"]  image:https://github.com/smallrye/smallrye-stork/workflows/SmallRye%20Build/badge.svg?branch=main[link={ci}]  image:https://sonarcloud.io/api/project_badges/measure?project=smallrye_smallrye-stork\u0026metric=alert_status[\"Quality Gate Status\", link={sonar}]\n\n_SmallRye Stork, Stork, in short, is a Service Discovery and Client-Side Load Balancer framework._\n\n=== Main features\n\n* Extensible service discovery mechanisms\n* Built-in support for Consul and Kubernetes\n* Customizable client load-balancing strategy\n* API and _managed_ approaches\n* Quarkus integration, but can be used in any environment\n* Imperative and Reactive\n\n=== Example\n\nLet's imagine you use https://www.consul.io/[Consul].\nConsul stores the list of service _instances_ you have and lets you locate them.\n\nStork bridges your application and Consul and lets you retrieve the services stored in Consul and select the most appropriate one:\n\n[source, java]\n----\nStork.initialize();                                                 // \u003c1\u003e\nStork stork = Stork.getInstance();                                  // \u003c2\u003e\nService service = stork.getService(\"my-service\");                   // \u003c3\u003e\nServiceInstance instance = service.selectServiceInstance()          // \u003c4\u003e\n    .await().atMost(Duration.ofSeconds(1));\nString url = \"http://\" + instance.getHost() + instance.getPort();   // \u003c5\u003e\n----\n1. Initializes Stork - you need to do that only once.\n2. Gets the Stork instance.\n3. Gets the `Service` object for `my-service`.\n4. Retrieves the service instance for `my-service`. This performs a lookup in Consul and a selection using a load-balancer.\n5. Builds your URL.\n\nThat example uses the programmatic API.\nWhen integrated into the framework, all these steps can be omitted, and you only need to configure the application:\n\n[source, properties]\n----\nstork.my-service.service-discovery.type=consul            # \u003c1\u003e\nstork.my-service.load-balancer.type=least-response-time   # \u003c2\u003e\n\nhello/mp-rest/url=stork://my-service/hello           # \u003c3\u003e\n----\n1. Configures that the `my-service` service uses Consul as service discovery backend\n2. Configures the load balancer for `my-service`\n3. Uses the `stork` scheme and indicates which service is targeted. When accessed, it will select the service instance using Stork.\n\n=== Contributing\n\nCheck the link:CONTRIBUTING.md[contribution guide] to get build and contribution instructions.\n\n=== Sponsors\n\nStork is part of the https://smallrye.io[SmallRye project].\nRed Hat sponsors the development of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallrye%2Fsmallrye-stork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmallrye%2Fsmallrye-stork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallrye%2Fsmallrye-stork/lists"}