{"id":30196613,"url":"https://github.com/megaprog/async-hessian","last_synced_at":"2025-08-13T05:27:25.638Z","repository":{"id":57739474,"uuid":"44427569","full_name":"Megaprog/async-hessian","owner":"Megaprog","description":"The approach to export Hessian service through Servlet 3.0 AsyncContext","archived":false,"fork":false,"pushed_at":"2015-10-31T09:22:51.000Z","size":152,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T14:21:34.719Z","etag":null,"topics":[],"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/Megaprog.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":"2015-10-17T07:15:35.000Z","updated_at":"2016-02-17T07:01:38.000Z","dependencies_parsed_at":"2022-08-27T03:41:25.573Z","dependency_job_id":null,"html_url":"https://github.com/Megaprog/async-hessian","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Megaprog/async-hessian","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megaprog%2Fasync-hessian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megaprog%2Fasync-hessian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megaprog%2Fasync-hessian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megaprog%2Fasync-hessian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Megaprog","download_url":"https://codeload.github.com/Megaprog/async-hessian/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megaprog%2Fasync-hessian/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270184250,"owners_count":24541495,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"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":[],"created_at":"2025-08-13T05:26:48.312Z","updated_at":"2025-08-13T05:27:25.585Z","avatar_url":"https://github.com/Megaprog.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Asynchronous Hessian\n\nThe approach to export [Hessian](http://hessian.caucho.com/) service through Servlet 3.0 AsyncContext \n\n## How to get it?\n\nYou can use it as a maven dependency:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.jmmo\u003c/groupId\u003e\n    \u003cartifactId\u003easync-hessian\u003c/artifactId\u003e\n    \u003cversion\u003e1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nOr download the latest build at:\n    https://github.com/megaprog/async-hessian/releases\n\n## How to use it?\n\nCreate client interface:\n\n```java\npublic interface HessianServiceInterface {\n\n    Integer synchronousCall();\n\n    Integer asynchronousCall();\n}\n```\n\nCreate server interface with same method signatures as in client one but asynchronous methods must return CompletableFuture:\n\n```java\npublic interface HessianServiceInterfaceAsync {\n\n    Integer synchronousCall();\n\n    CompletableFuture\u003cInteger\u003e asynchronousCall();\n}\n```\n\nImplement server asynchronous interface:\n\n```java\npublic class HessianServiceInterfaceAsyncImpl implements HessianServiceInterfaceAsync {\n    private static final Logger log = Logger.getLogger(HessianServiceInterfaceAsyncImpl.class.getName());\n\n    @Override\n    public Integer synchronousCall() {\n        log.info(() -\u003e \"Calling from http processing thread\");\n        return 1;\n    }\n\n    @Override\n    public CompletableFuture\u003cInteger\u003e asynchronousCall() {\n        return CompletableFuture.supplyAsync(() -\u003e {\n            log.info(() -\u003e \"Calling from ForkJoinPool thread\");\n            return 2;\n        });\n    }\n}\n```\n\nExport server interface:\n\n```xml\n\u003cbean name=\"/HessianService\" class=\"org.jmmo.hessian.HessianServiceExporterAsync\"\u003e\n    \u003cproperty name=\"service\" ref=\"hessianServiceAsync\"/\u003e\n    \u003cproperty name=\"serviceInterface\" value=\"org.jmmo.hessian.example.server.HessianServiceInterfaceAsync\"/\u003e\n\u003c/bean\u003e\n\n\u003cbean id=\"hessianServiceAsync\" class=\"org.jmmo.hessian.example.server.HessianServiceInterfaceAsyncImpl\"/\u003e\n```\n\nDefine proxy service bean in client:\n\n```xml\n\u003cbean id=\"hessianService\" class=\"org.springframework.remoting.caucho.HessianProxyFactoryBean\"\u003e\n    \u003cproperty name=\"serviceInterface\" value=\"org.jmmo.hessian.example.client.HessianServiceInterface\"/\u003e\n    \u003cproperty name=\"serviceUrl\" value=\"${hessianServiceUrl}\"/\u003e\n\u003c/bean\u003e\n```\n\nSee more at client-server example:\n    https://github.com/Megaprog/async-hessian/tree/master/example\n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegaprog%2Fasync-hessian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegaprog%2Fasync-hessian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegaprog%2Fasync-hessian/lists"}