{"id":20645220,"url":"https://github.com/quan930/smilodon","last_synced_at":"2026-04-22T04:35:54.982Z","repository":{"id":52709791,"uuid":"327306605","full_name":"quan930/smilodon","owner":"quan930","description":"java-服务注册中心-轻量级实现-负载均衡","archived":false,"fork":false,"pushed_at":"2021-04-20T15:04:54.000Z","size":796,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T16:16:55.157Z","etag":null,"topics":["discoveryclient","loadbalance","springcloud"],"latest_commit_sha":null,"homepage":"","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/quan930.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":"2021-01-06T12:35:32.000Z","updated_at":"2021-04-20T15:04:57.000Z","dependencies_parsed_at":"2022-08-21T19:30:18.642Z","dependency_job_id":null,"html_url":"https://github.com/quan930/smilodon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/quan930/smilodon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan930%2Fsmilodon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan930%2Fsmilodon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan930%2Fsmilodon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan930%2Fsmilodon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quan930","download_url":"https://codeload.github.com/quan930/smilodon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan930%2Fsmilodon/sbom","scorecard":{"id":754982,"data":{"date":"2025-08-11","repo":{"name":"github.com/quan930/smilodon","commit":"9e5ff4a94e7d1dc5a37ae7bec998e68e2e8489e5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"69 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-vmq6-5m68-f53m","Warn: Project is vulnerable to: GHSA-668q-qrv7-99fm","Warn: Project is vulnerable to: GHSA-6v67-2wr5-gvf4","Warn: Project is vulnerable to: GHSA-pr98-23f8-jwxv","Warn: Project is vulnerable to: GHSA-pv7h-hx5h-mgfj","Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-wf8f-6423-gfxg","Warn: Project is vulnerable to: GHSA-3x8x-79m2-3w2w","Warn: Project is vulnerable to: GHSA-57j2-w4cx-62h2","Warn: Project is vulnerable to: GHSA-jjjh-jjxp-wpff","Warn: Project is vulnerable to: GHSA-rgv9-q543-rqg4","Warn: Project is vulnerable to: GHSA-27hp-xhwr-wr2m","Warn: Project is vulnerable to: GHSA-2rvv-w9r2-rg7m","Warn: Project is vulnerable to: GHSA-5j33-cvvr-w245","Warn: Project is vulnerable to: GHSA-7w75-32cg-r6g2","Warn: Project is vulnerable to: GHSA-83qj-6fr2-vhqg","Warn: Project is vulnerable to: GHSA-fccv-jmmp-qg76","Warn: Project is vulnerable to: GHSA-g8pj-r55q-5c2v","Warn: Project is vulnerable to: GHSA-h2fw-rfh5-95r3","Warn: Project is vulnerable to: GHSA-h3gc-qfqq-6h8f","Warn: Project is vulnerable to: GHSA-hfrx-6qgj-fp6c","Warn: Project is vulnerable to: GHSA-j39c-c8hj-x4j3","Warn: Project is vulnerable to: GHSA-jgwr-3qm3-26f3","Warn: Project is vulnerable to: GHSA-p22x-g9px-3945","Warn: Project is vulnerable to: GHSA-q3mw-pvr8-9ggc","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GHSA-r6j3-px5g-cq3x","Warn: Project is vulnerable to: GHSA-wc4r-xq3c-5cf3","Warn: Project is vulnerable to: GHSA-wm9w-rjj3-j356","Warn: Project is vulnerable to: GHSA-v682-8vv8-vpwr","Warn: Project is vulnerable to: GHSA-4cx2-fc23-5wg6","Warn: Project is vulnerable to: GHSA-6xx3-rg99-gc3p","Warn: Project is vulnerable to: GHSA-8xfc-gm6g-vgpv","Warn: Project is vulnerable to: GHSA-hr8g-6v94-x4m9","Warn: Project is vulnerable to: GHSA-v435-xc8x-wvr9","Warn: Project is vulnerable to: GHSA-wjxj-5m7g-mg7q","Warn: Project is vulnerable to: GHSA-v6w3-2prq-h95f","Warn: Project is vulnerable to: GHSA-7v6m-28jr-rg84","Warn: Project is vulnerable to: GHSA-x83m-pf6f-pf9g","Warn: Project is vulnerable to: GHSA-rc42-6c7j-7h5r","Warn: Project is vulnerable to: GHSA-jjfh-589g-3hjx","Warn: Project is vulnerable to: GHSA-g5h3-w546-pj7f","Warn: Project is vulnerable to: GHSA-xf96-w227-r7c4","Warn: Project is vulnerable to: GHSA-36p3-wjmg-h94x","Warn: Project is vulnerable to: GHSA-mg83-c7gq-rv5c","Warn: Project is vulnerable to: GHSA-hh26-6xwr-ggv7","Warn: Project is vulnerable to: GHSA-4gc7-5j7h-4qph","Warn: Project is vulnerable to: GHSA-4wp7-92pw-q264","Warn: Project is vulnerable to: GHSA-g5mm-vmx4-3rg7","Warn: Project is vulnerable to: GHSA-6gf2-pvqw-37ph","Warn: Project is vulnerable to: GHSA-rfmp-97jj-h8m6","Warn: Project is vulnerable to: GHSA-558x-2xjg-6232","Warn: Project is vulnerable to: GHSA-564r-hj7v-mcr5","Warn: Project is vulnerable to: GHSA-9cmq-m9j5-mvww","Warn: Project is vulnerable to: GHSA-wxqc-pxw9-g2p8","Warn: Project is vulnerable to: GHSA-2rmj-mq67-h97g","Warn: Project is vulnerable to: GHSA-2wrp-6fg6-hmc5","Warn: Project is vulnerable to: GHSA-4wrc-f8pq-fpqp","Warn: Project is vulnerable to: GHSA-ccgv-vj62-xf9h","Warn: Project is vulnerable to: GHSA-gfwj-fwqj-fp3v","Warn: Project is vulnerable to: GHSA-hgjh-9rj2-g67j","Warn: Project is vulnerable to: GHSA-g5vr-rgqm-vf78","Warn: Project is vulnerable to: GHSA-3mc7-4q67-w48m","Warn: Project is vulnerable to: GHSA-98wm-3w3q-mw94","Warn: Project is vulnerable to: GHSA-9w3m-gqgf-c4p9","Warn: Project is vulnerable to: GHSA-c4r9-r8fh-9vj2","Warn: Project is vulnerable to: GHSA-hhhw-99gj-p3c3","Warn: Project is vulnerable to: GHSA-mjmj-j48q-9wg2","Warn: Project is vulnerable to: GHSA-w37g-rhq8-7m4j"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T21:23:34.677Z","repository_id":52709791,"created_at":"2025-08-22T21:23:34.677Z","updated_at":"2025-08-22T21:23:34.677Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32121218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["discoveryclient","loadbalance","springcloud"],"created_at":"2024-11-16T16:19:12.885Z","updated_at":"2026-04-22T04:35:54.968Z","avatar_url":"https://github.com/quan930.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smilodon\n![release:0.3.3](https://img.shields.io/badge/release-0.3.3-blue)\n![Spring Boot Version:2.3.0.RELEASE](https://img.shields.io/badge/Spring%20Boot%20Version-2.3.0.RELEASE-brightgreen)\n![Spring Cloud Version:Hoxton.SR8](https://img.shields.io/badge/Spring%20Cloud%20Version-Hoxton.SR8-brightgreen)\n![last-commit](https://img.shields.io/github/last-commit/quan930/smilodon)\n\n\n### 简介\n![smilodon](https://github.com/quan930/smilodon/blob/main/description/show.jpeg)\nsmilodon中文是剑齿虎，是一套服务注册发现工具包，实现的目的是更好了解微服务的原理，实现`spring-cloud-commons`部分功能，支持`@LoadBalanced`注解，可以使用RestTemplate调用服务\n\n### smilodon服务器\n\n##### 配置smilodon服务器\n+ 先决条件\n    + JDK 1.8或更高\n    + springboot 2.3或更高\n    + springcloud Hoxton.SR8或更高\n+ maven 依赖\n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecn.lilq.smilodon\u003c/groupId\u003e\n        \u003cartifactId\u003esmilodon-server-spring-boot-starter\u003c/artifactId\u003e\n        \u003cversion\u003e0.2.4\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n##### 构建smilodon服务器\n+ 启用smilodon服务器\n    ```java\n    @EnableSmilodonServer\n    @SpringBootApplication\n    public class SmilodonServerApplication {\n        public static void main(String[] args) {\n            SpringApplication.run(SmilodonServerApplication.class,args);\n        }\n    }\n    ```\n+ 可选配置\n    ```properties\n    smilodon.instance.prefer-ip-address=true\n    smilodon.instance.hostname=127.0.0.1\n    smilodon.server.max-wait-time=60\n    smilodon.server.testing-time=20\n    ```\n\n### smilodon客户端\n##### 配置smilodon客户端\n+ 先决条件\n    + JDK 1.8或更高\n    + springboot 2.3或更高\n    + springcloud Hoxton.SR8或更高\n+ maven 依赖\n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecn.lilq.smilodon\u003c/groupId\u003e\n        \u003cartifactId\u003esmilodon-client-spring-boot-starter\u003c/artifactId\u003e\n        \u003cversion\u003e0.2.4\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n##### 构建smilodon客户端\n+ 启用smilodon服务器\n  ```java\n  @EnableSmilodonClient\n  @SpringBootApplication\n  public class SmilodonClientApplication {\n      public static void main(String[] args) {\n          SpringApplication.run(SmilodonClientApplication.class,args);\n      }\n  }\n  ```\n+ 可选配置\n    ```properties\n    smilodon.instance.prefer-ip-address=true\n    smilodon.instance.instance-id=ordersys5001\n    smilodon.client.fetch-registry=false\n    #smilodon.client.fetch-registry=true\n    smilodon.client.service-url=http://localhost:7010\n    #smilodon.client.register-with-smilodon=false\n    smilodon.client.register-with-smilodon=true\n    ```\n+ 使用`discoveryClient`进行服务发现\n    ```java\n    @Resource\n    private DiscoveryClient discoveryClient;\n    \n    @ResponseBody\n    @RequestMapping(value = \"/\",method = RequestMethod.GET)\n    public void getServices(){\n        System.out.println(discoveryClient.getServices());\n    }\n    \n    @ResponseBody\n    @RequestMapping(value = \"/{id}\",method = RequestMethod.GET)\n    public void getInstances(@PathVariable String id){\n        System.out.println(discoveryClient.getInstances(id));\n    }\n    ```\n+ 使用具有`@LoadBalanced`注解的RestTemplate调用服务\n    ```java\n    @ResponseBody\n    @RequestMapping(value = \"/hello\", method = RequestMethod.GET)\n    public Response hello() {\n        return new Response(200,\"successful\",\"hello world,port:\"+serverPort);\n    }\n    \n    @ResponseBody\n    @RequestMapping(value = \"/sayhello\", method = RequestMethod.GET)\n    public Response sayHello() {\n        Response response = restTemplate.getForObject(\"http://ORDER-SERVER/hello\", Response.class);\n        System.out.println(response);\n        return response;\n    }\n    \n    @Bean\n    @LoadBalanced\n    public RestTemplate restTemplate() {\n        return new RestTemplate();\n    }\n    ```\n### 演示\n+ [test地址](https://github.com/quan930/smilodon/tree/main/smilodon-test)\n### 不足\n+ 动态注入controller\n+ 心跳检测\n+ 订阅controller 动态注入  (注入异常)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquan930%2Fsmilodon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquan930%2Fsmilodon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquan930%2Fsmilodon/lists"}