{"id":37028175,"url":"https://github.com/fomjar/fomjar-core","last_synced_at":"2026-01-14T03:21:38.347Z","repository":{"id":52557069,"uuid":"210706329","full_name":"fomjar/fomjar-core","owner":"fomjar","description":"Aliyun中间件和开源中间件的统一封装，工程化的集成场景下的各类方案支持","archived":false,"fork":false,"pushed_at":"2022-12-10T06:05:26.000Z","size":396,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T20:07:11.106Z","etag":null,"topics":["algorithm","aliyun","annotation","async","data-structure","distributed","el","expression-language","long-connection","mq","oss","process-io","spring"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fomjar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-24T22:11:57.000Z","updated_at":"2021-12-29T03:39:00.000Z","dependencies_parsed_at":"2023-01-26T03:46:01.039Z","dependency_job_id":null,"html_url":"https://github.com/fomjar/fomjar-core","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fomjar/fomjar-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fomjar%2Ffomjar-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fomjar%2Ffomjar-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fomjar%2Ffomjar-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fomjar%2Ffomjar-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fomjar","download_url":"https://codeload.github.com/fomjar/fomjar-core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fomjar%2Ffomjar-core/sbom","scorecard":{"id":406243,"data":{"date":"2025-08-11","repo":{"name":"github.com/fomjar/fomjar-core","commit":"cc5744f65cb7750b277855976e5d4092f6495f40"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"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":"Code-Review","score":0,"reason":"Found 0/28 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":"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"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 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"65 existing vulnerabilities detected","details":["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-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-w33c-445m-f8w7","Warn: Project is vulnerable to: GHSA-6phf-73q6-gh87","Warn: Project is vulnerable to: GHSA-p66x-2cv9-qq3v","Warn: Project is vulnerable to: GHSA-wxr5-93ph-8wr9","Warn: Project is vulnerable to: GHSA-9vjp-v76f-g363","Warn: Project is vulnerable to: GHSA-grg4-wf29-r9vv","Warn: Project is vulnerable to: GHSA-269q-hmxg-m83q","Warn: Project is vulnerable to: GHSA-5jpm-x58v-624v","Warn: Project is vulnerable to: GHSA-5mcr-gq6c-3hq2","Warn: Project is vulnerable to: GHSA-wx5j-54mm-rqqq","Warn: Project is vulnerable to: GHSA-389x-839f-4rhx","Warn: Project is vulnerable to: GHSA-xq3w-v528-46rv","Warn: Project is vulnerable to: GHSA-6mjq-h674-j845","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v","Warn: Project is vulnerable to: GHSA-7r82-7xv7-xcpj","Warn: Project is vulnerable to: GHSA-cj7v-27pg-wf7q","Warn: Project is vulnerable to: GHSA-hmr7-m48g-48f6","Warn: Project is vulnerable to: GHSA-qh8g-58pp-2wxh","Warn: Project is vulnerable to: GHSA-26vr-8j45-3r4w","Warn: Project is vulnerable to: GHSA-86wm-rrjm-8wh8","Warn: Project is vulnerable to: GHSA-g8m5-722r-8whq","Warn: Project is vulnerable to: GHSA-m394-8rww-3jr7","Warn: Project is vulnerable to: GHSA-m6cp-vxjx-65j6","Warn: Project is vulnerable to: GHSA-p26g-97m4-6q7c","Warn: Project is vulnerable to: GHSA-q4rv-gq96-w7c5","Warn: Project is vulnerable to: GHSA-qw69-rqj8-6qw8","Warn: Project is vulnerable to: GHSA-x3rh-m7vp-35f2","Warn: Project is vulnerable to: GHSA-58qw-p7qm-5rvh","Warn: Project is vulnerable to: GHSA-2363-cqg2-863c","Warn: Project is vulnerable to: GHSA-4hvc-qwr2-f8rv","Warn: Project is vulnerable to: GHSA-rc42-6c7j-7h5r","Warn: Project is vulnerable to: GHSA-xf96-w227-r7c4","Warn: Project is vulnerable to: GHSA-36p3-wjmg-h94x","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-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-18T21:19:54.863Z","repository_id":52557069,"created_at":"2025-08-18T21:19:54.863Z","updated_at":"2025-08-18T21:19:54.863Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["algorithm","aliyun","annotation","async","data-structure","distributed","el","expression-language","long-connection","mq","oss","process-io","spring"],"created_at":"2026-01-14T03:21:37.688Z","updated_at":"2026-01-14T03:21:38.339Z","avatar_url":"https://github.com/fomjar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fomjar-core\n\n- 提供了Aliyun中间件和开源中间件的统一封装，在各类场景下给出可用方案。\n- 在模块复杂或工程化的集成场景下提供有用的工具库。\n\n## 目录\n\n- *dist*: 分布式包。各类分布式中间件的统一封装。在Spring环境下会进行Bean的自动配置。分布式锁、选举等\n- *el*: 表达式包。各类模板引擎和表达式引擎的统一封装。也可以用来做Web端推送。在Spring环境下会进行Bean的自动配置。支持注册自定义变量、自定义方法\n- *lang*: 基础功能宝。包括：算法摘要、注解扫描、异步任务、数据结构等\n- *lio*: 长连接包。各类网络协议的长连接的统一封装。在Spring环境下提供了基于注解的LIO容器自动配置。Websocket、Socket-IO、TCP、Redis\n- *mq*: 消息队列包。各类消息中间件的统一封装。在Spring环境下会进行Bean的自动配置。AliyunMQ、RedisMQ\n- *oss*: 对象存储包。各类对象存储中间件的统一封装。在Spring环境下会进行Bean的自动配置。AliyunOSS、MinioOSS\n- *pio*: 进程IO包。操作系统进程的IO异步读写工具\n- *spring*: Spring支持包。框架的Spring启动器自动配置以及Spring相关工具集。动态获取Bean、动态获取配置项等\n\n## 依赖导入\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.fomjar\u003c/groupId\u003e\n    \u003cartifactId\u003efomjar-core\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## DEMO\n\n### lang(基础功能)\n\n支持的摘要算法：md2、md5、sha1、sha256、sha384、sha512、crc32。\n```java\nSystem.out.println(Digest.md5(\"password\"));\n```\n简单的注解扫描\n```java\nAnno.scan(\"com.fomjar.core\", new AnnoScanAdapter() {\n    @Override\n    public void read(Annotation[] annotations, Class\u003c?\u003e clazz) {\n        if (0 \u003c annotations.length)\n            System.out.println(clazz);\n        for (Annotation annotation : annotations) {\n            System.out.println(\"[CLASS  ANNO] \" + annotation.annotationType());\n        }\n    }\n}\n```\n这是一个扫描Controller接口清单的例子：\n```java\nAnno.scan(new URLClassLoader(new URL[]{\n                new File(\"/Users/fomjar/Documents/code/fomjar-core/target/classes\").toURI().toURL(),\n        }),\n        \"com.fomjar.core\",\n        null,\n        AnnoScanFilter.any(Controller.class, RestController.class),\n        new AnnoScanAdapter() {\n            @Override\n            public void read(Annotation[] annotations, Class\u003c?\u003e type, Method method) {\n                Annotation anno0 = Anno.any(type.getAnnotations(), RequestMapping.class, GetMapping.class, PostMapping.class);\n                Annotation anno1 = Anno.any(method.getAnnotations(), RequestMapping.class, GetMapping.class, PostMapping.class);\n                if (null == anno1) return;\n\n                String[] path0 = new String[0];\n                String[] path1 = new String[0];\n                try {\n                    path0 = null == anno0 ? new String[] {} : Struct.call(anno0, String[].class, \"value\");\n                    path1 = Struct.call(anno1, String[].class, \"value\");\n                } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {\n                    e.printStackTrace();\n                }\n\n                if (0 == path1.length) return;\n\n                for (String p0 : path0) {\n                    for (String p1 : path1) {\n                        String path = \"/\" + p0 + \"/\" + p1;\n                        while (path.contains(\"//\"))\n                            path = path.replace(\"//\", \"/\");\n                        while (path.endsWith(\"/\"))\n                            path = path.substring(0, path.length() - 1);\n\n                        System.out.println(path);\n                    }\n                }\n            }\n        });\n```\n异步工具库对异步执行操作做了优化，对系统整体性能有较好的提升。\n```java\n// 异步执行\nTask.async(() -\u003e {\n    System.out.println(Thread.currentThread().getName() + \": \" + System.currentTimeMillis());\n});\n// 延迟任务\nTask.delay(() -\u003e {\n    System.out.println(Thread.currentThread().getName() + \": \" + System.currentTimeMillis());\n}, 1000L);\n// 循环任务\nTask.loop(() -\u003e {\n    System.out.println(Thread.currentThread().getName() + \": \" + System.currentTimeMillis());\n}, \"0/2 * * * * ?\");\n```\nSpring下的异步支持：\n```java\n@Autowired\nprivate ExecutorService pool;\n\nfor (int i = 0; i \u003c 8; i++) {\n    final int n = i;\n    this.pool.submit(() -\u003e {\n        try {Thread.sleep(100L);}\n        catch (InterruptedException e) {e.printStackTrace();}\n        System.out.println(Thread.currentThread().getName() + \": \" + n);\n    });\n}\nthis.pool.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);\n```\n数据结构访问：\n```java\nSystem.out.println(Struct.get(new LinkedList\u003c\u003e(), \"size\")); // 0\nSystem.out.println(Struct.call(\"123456\", \"substring\", 1, 4)); // \"234\"\n```\n常量修改：\n```java\nStruct.setFinalDouble(Double.class, \"MAX_VALUE\", 1.1D);\nSystem.out.println(Double.MAX_VALUE); // 1.1\n\nString s = \"12345\";\nStruct.setFinalObject(s, \"value\", new char[] {'a', 'b', 'c', 'd', 'e'}); // \"abcde\"\n```\n\n### dist(分布式)\n目前支持基于Redis的实现。\n主机选举：\n```java\n@Autowired\nprivate Dist dist;\n\nthis.dist.elect(\"Some-Topic\", new Election() {\n    @Override\n    public void elected(String topic) {\n        System.out.println(\"Elected\");\n    }\n    @Override\n    public void lost(String topic) {\n        System.out.println(\"Lost\");\n    }\n});\n```\n分布式锁：\n```java\n@Autowired\nprivate Dist dist;\n\nString name = \"123\";\nthis.dist.lock(() -\u003e {\n    System.out.println(Thread.currentThread().getName() + \": \" + System.currentTimeMillis());\n    try { Thread.sleep(100L); }\n    catch (InterruptedException e) { e.printStackTrace(); }\n}, name， 3000L);\n```\n\n### el(表达式)\n实现基于Aviator和Freemarker，整体语法基本相同，默认注册了很多有用的工具函数，支持注册中文变量。\n```java\n@Autowired\nprivate EL el;\n    \nSystem.out.println(this.el.eval(\"now('yyyy/MM/dd HH/mm/ss.SSS')\"));\nSystem.out.println(this.el.eval(\"randomBoolean()\"));\nSystem.out.println(this.el.eval(\"randomInt()\"));\nSystem.out.println(this.el.eval(\"randomLong()\"));\nSystem.out.println(this.el.eval(\"randomFloat()\"));\nSystem.out.println(this.el.eval(\"randomDouble()\"));\nSystem.out.println(this.el.eval(\"length('abcde')\")); // \"5\"\nSystem.out.println(this.el.eval(\"indexOf('abcde', 'cd')\")); // \"2\"\nSystem.out.println(this.el.eval(\"lastIndexOf('abcde', 'cd')\")); // \"2\"\nSystem.out.println(this.el.eval(\"trim('  abcde')\")); // \"abcde\"\nSystem.out.println(this.el.eval(\"reverse('abcde')\")); // \"edcba\"\nSystem.out.println(this.el.eval(\"substring('abcde', 1, 3)\")); // \"bc\"\nSystem.out.println(this.el.eval(\"substring('abcde', 3)\")); // \"de\"\nSystem.out.println(this.el.eval(\"replace('abcde', 'c', 'm')\")); // \"abmde\"\nSystem.out.println(this.el.eval(\"split('abcde', 'c')[0]\")); // \"ab\"\nSystem.out.println(this.el.eval(\"if(1 \u003e 0, 'g', 'l')\")); // \"g\"\nSystem.out.println(this.el.eval(\"ifblank('', 'abcd')\")); // \"abcd\"\nSystem.out.println(this.el.eval(\"ifblank('1234', 'abcd')\")); // \"1234\"\nSystem.out.println(this.el.eval(\"Math.PI\")); // \"3.141592653589793\"\nSystem.out.println(this.el.eval(\"Math.E\")); // \"2.718281828459045\"\nSystem.out.println(this.el.eval(\"Math.abs(-15)\")); // \"15\"\nSystem.out.println(this.el.eval(\"Math.sqrt(2)\")); // \"1.4142135623730951\"\nSystem.out.println(this.el.eval(\"'123' + 'abc'\")); // \"123abc\"\n```\n\n### lio(长连接)\n实现基于TCP、Websocket、SocketIO、Redis。\n```java\n@RunWith(SpringRunner.class)\n@SpringBootTest(classes = {TestFomjarCoreApplication.class})\n// 控制器定义\n@LIOController\npublic class TestLIOSpring {\n    // 请求数据\n    @LIORequest\n    public String accept(JSONObject json) {\n        System.out.println(\"server received: \" + json.toString());\n        return json.toString();\n    }\n    // 连接事件\n    @LIOConnect\n    public void connect(LIO lio) {\n        System.out.println(String.format(\"Client %s:%d connect\", lio.remoteHost(), lio.remotePort()));\n    }\n    // 断连事件\n    @LIODisconnect\n    public void disconnect(LIO lio) {\n        System.out.println(String.format(\"Client %s:%d disconnect\", lio.remoteHost(), lio.remotePort()));\n    }\n    // 创建客户端发起请求\n    @Test\n    public void test() throws IOException, InterruptedException, URISyntaxException {\n//        LIO lio = new TCPLIO(new Socket(\"127.0.0.1\", 9001));\n        LIO lio = new WebSocketLIO(new URI(\"ws://127.0.0.1:\" + 9001 + \"/hello?a=1\u0026b=2\"));\n        while (!lio.isOpen()) {\n            Thread.sleep(100L);\n        }\n        for (int i = 0; i \u003c 3; i++) {\n            lio.write(\"{\\\"hello\\\" : \\\"world!\\\"}\");\n            Thread.sleep(200L);\n        }\n        lio.close();\n    }\n}\n```\n\n### mq(消息队列)\n实现基于AliyunMQ和Redis。\n```java\n@Autowired\nprivate MQ mq;\n\n// 消费\nthis.mq.consume(\"test\", msg -\u003e {\n    System.out.println(msg.toString());\n});\n// 生产\nfor (int i = 0; i \u003c 3; i++) {\n    this.mq.produce(new MQMsg().tag(\"test\").data(\"Hello world!\"));\n    Thread.sleep(200L);\n}\n```\n\n### oss(对象存储)\n实现基于AliyunOSS和Minio。\n```java\n@Autowired\nprivate OSS oss;\n\nlong time = System.currentTimeMillis();\nSystem.out.println(oss.upload(\"test-\" + time + \".txt\", (\"hello world! \" + time).getBytes())); // http://url\n```\n\n### pio(进程IO)\n进程读为异步、写为同步。\n```java\nnew PIO()\n    .readInput(new PIOLineReader() {\n        @Override\n        public void readLine(String line) throws Exception {\n            logger.info(\"[OUT] {}\", line);\n        }\n    })\n    .readError(new PIOLineReader() {\n        @Override\n        public void readLine(String line) throws Exception {\n            logger.info(\"[ERR] {}\", line);\n        }\n    })\n    .startup(\"java -h\")\n    .await();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffomjar%2Ffomjar-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffomjar%2Ffomjar-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffomjar%2Ffomjar-core/lists"}