{"id":19885236,"url":"https://github.com/dinstone/photon","last_synced_at":"2026-02-17T16:02:07.537Z","repository":{"id":41555058,"uuid":"152077634","full_name":"dinstone/photon","owner":"dinstone","description":"photon is a message exchange framework","archived":false,"fork":false,"pushed_at":"2025-02-10T17:40:54.000Z","size":331,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T04:54:46.560Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dinstone.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-08T12:39:30.000Z","updated_at":"2024-10-28T02:19:13.000Z","dependencies_parsed_at":"2023-01-23T17:46:15.789Z","dependency_job_id":"b823cb81-46b3-47c3-9508-0223282d322f","html_url":"https://github.com/dinstone/photon","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/dinstone/photon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fphoton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fphoton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fphoton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fphoton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinstone","download_url":"https://codeload.github.com/dinstone/photon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fphoton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29549218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-11-12T17:33:42.122Z","updated_at":"2026-02-17T16:02:07.516Z","avatar_url":"https://github.com/dinstone.png","language":"Java","readme":"# Photon\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/dinstone/photon/blob/master/LICENSE)\n[![Maven Central](https://img.shields.io/maven-central/v/com.dinstone.photon/photon.svg?label=Maven%20Central)](https://search.maven.org/search?q=com.dinstone.photon)\n\n# Overview\n**Photon** is an asynchronous message exchange framework based on Netty.\n\n# Features\n* Efficient custom protocol ([Photon](https://github.com/dinstone/photon) message exchange protocol)\n    - Request-Response Pattern\n    - One-way / Notify Pattern\n\t\n* High-performance NIO socket framework support - Netty4\n\n# Quick Start\n\n## add dependency:\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.dinstone.photon\u003c/groupId\u003e\n\t\u003cartifactId\u003ephoton\u003c/artifactId\u003e\n\t\u003cversion\u003e1.2.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n## message provider:\n\n```java\n\npublic static void main(String[] args) throws Exception {\n  AcceptOptions acceptOptions = new AcceptOptions();\n  acceptOptions.setEnableSsl(true);\n  acceptOptions.setIdleTimeout(60000);\n  SelfSignedCertificate cert = new SelfSignedCertificate();\n  acceptOptions.setPrivateKey(cert.key());\n  acceptOptions.setCertChain(new X509Certificate[] { cert.cert() });\n  Acceptor acceptor = new Acceptor(acceptOptions);\n  acceptor.setProcessor(new MessageProcessor() {\n\n    @Override\n    public void process(Connection connection, Request req) {\n      LOG.info(\"Request is {}\", req.getSequence());\n      Notice notice = new Notice();\n      notice.setAddress(\"order.created\");\n      notice.setContent(req.getContent());\n      CompletableFuture\u003cVoid\u003e f = connection.sendMessage(notice);\n      f.thenAccept((v) -\u003e {\n        Response response = new Response();\n        response.setSequence(req.getSequence());\n        response.setStatus(Status.SUCCESS);\n        response.setContent(req.getContent());\n        connection.sendMessage(response);\n      });\n    }\n\n  });\n\n  acceptor.bind(new InetSocketAddress(\"127.0.0.1\", 4444));\n\n  System.in.read();\n\n  acceptor.destroy().awaitUninterruptibly();\n}\n```\n\n## message consumer:\n\n```java\npublic static void main(String[] args) throws Throwable {\n  ConnectOptions connectOptions = new ConnectOptions();\n  connectOptions.setEnableSsl(true);\n  Connector connector = new Connector(connectOptions);\n\n  Connection connection = connector.connect(new InetSocketAddress(\"127.0.0.1\", 4444));\n  LOG.info(\"channel active is {}\", connection.isActive());\n\n  Request request = new Request();\n  request.setSequence(1);\n  request.setTimeout(10000);\n  request.setContent(\"Hello World\".getBytes());\n\n  LOG.info(\"async request is  {}\", request);\n  connection.sendRequest(request).thenAccept(response -\u003e {\n    LOG.info(\"async response is {}\", response);\n  });\n\n  request = new Request();\n  request.setSequence(2);\n  request.setTimeout(3000);\n\n  LOG.info(\"sync request is  {}\", request);\n  Response response = connection.sendRequest(request).get();\n  LOG.info(\"sync response is {}\", response);\n  \n  System.in.read();\n\n  connector.destroy().awaitUninterruptibly();\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinstone%2Fphoton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinstone%2Fphoton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinstone%2Fphoton/lists"}