{"id":13753343,"url":"https://github.com/weibocom/motan-openresty","last_synced_at":"2025-10-04T03:50:16.710Z","repository":{"id":70296904,"uuid":"108809023","full_name":"weibocom/motan-openresty","owner":"weibocom","description":"A cross-language RPC framework for rapid development of high performance distributed services based on OpenResty.","archived":false,"fork":false,"pushed_at":"2025-01-10T02:46:16.000Z","size":343,"stargazers_count":124,"open_issues_count":0,"forks_count":31,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-25T10:02:39.115Z","etag":null,"topics":["cloud-native","lua","luajit","microservice","motan-openresty","nginx","openresty","rpc","service-mesh"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/weibocom.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-30T06:10:05.000Z","updated_at":"2025-01-10T02:46:20.000Z","dependencies_parsed_at":"2025-03-03T01:10:32.604Z","dependency_job_id":"1ac5bb68-0187-43e6-91af-4423c4dd2f0a","html_url":"https://github.com/weibocom/motan-openresty","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/weibocom/motan-openresty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibocom%2Fmotan-openresty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibocom%2Fmotan-openresty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibocom%2Fmotan-openresty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibocom%2Fmotan-openresty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weibocom","download_url":"https://codeload.github.com/weibocom/motan-openresty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weibocom%2Fmotan-openresty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278262441,"owners_count":25957937,"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-10-04T02:00:05.491Z","response_time":63,"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":["cloud-native","lua","luajit","microservice","motan-openresty","nginx","openresty","rpc","service-mesh"],"created_at":"2024-08-03T09:01:20.643Z","updated_at":"2025-10-04T03:50:16.693Z","avatar_url":"https://github.com/weibocom.png","language":"Lua","funding_links":[],"categories":["Lua","service-mesh"],"sub_categories":[],"readme":"# Motan-OpenResty\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/weibocom/motan/blob/master/LICENSE)\n[![https://travis-ci.org/weibocom/motan-openresty.svg?branch=master](https://travis-ci.org/weibocom/motan-openresty.svg?branch=master)](https://travis-ci.org/weibocom/motan-openresty)\n\n\n# Overview \n[Motan][motan] is a cross-language remote procedure call(RPC) framework \nfor rapid development of high performance distributed services.\n\nThis project is the OpenResty Motan implementation. \nProvides OpenResty motan server, motan client.\n\n# Features\n- Interactive with mulit language through motan2 protocol,such as Java, PHP.\n- Provides cluster support and integrate \nwith popular service discovery services like [Consul][consul]. \n- Supports advanced scheduling features like \nweighted load-balance, scheduling cross IDCs, etc.\n- Optimization for high load scenarios, \nprovides high availability in production environment.\n\n# Quick Start\n\n## Installation\n\n```sh\ngit clone https://github.com/weibocom/motan-openresty.git motan\n```\n\nThe quick start gives very basic example of running client and server on the same machine. \nFor the detailed information about using and developing Motan, please jump to [Documents](#documents).\nthe demo case is in the examples/ directory.\n\n## Motan server\n\n1. Create examples/motan-service/sys/MOTAN_SERVER_CONF to config service\n\n```ini\n;config of registries\n[motan.registry.consul-test-motan2]\nprotocol=consul\nhost=10.211.55.3\nport=8500\nregistryRetryPeriod=30000\nregistrySessionTimeout=10000\nrequestTimeout=5000\n\n;conf of services\n[motan.basicRefer.simple_rpc_ref]\ngroup=yf-api-core\nregistry=consul-test-motan2\nserialization=simple\nprotocol=motan2\nversion=0.1\nrequestTimeout=1000\nhaStrategy=failover\nloadbalance=random\nfilter=accessLog,metrics\nmaxClientConnection=10\nminClientConnection=1\nretries=0\napplication=whos-agent\n\n[motan.service.or_service]\ngroup=idevz-test-static\npath=com.weibo.motan.status\nregistry=consul-test-motan2\nversion=1\nport=1234\nprotocol=motan2\nserialization=simple\nbasicRefer=simple_rpc_service\n```\n\n2. Write an implementation, create and start RPC Server:\nexamples/motan-service/status.lua.\n\n```lua\nlocal setmetatable = setmetatable\n\nlocal _M = {\n    _VERSION = \"0.1.0\"\n}\n\nlocal mt = {__index = _M}\n\nfunction _M.new(self, opts)\n    return setmetatable({}, mt)\nend\n\nfunction _M.show_batch(self, opts)\n    \n    return \"--\u003e Motan\" .. \"-\u003enot name-----\u003e\\n\" .. sprint_r(opts) .. num\n\nend\n\nreturn _M\n```\n\n## Motan client\n\n1. Create examples/motan-service/sys/MOTAN_CLIENT_CONF \nto config service for subscribe\n\n```ini\n;config of registries\n[motan.registry.consul-test-motan2]\nprotocol=consul\nhost=10.211.55.3\nport=8500\nregistryRetryPeriod=30000\nregistrySessionTimeout=10000\nrequestTimeout=5000\n\n;conf of refers\n[motan.basicRefer.simple_rpc_ref]\ngroup=yf-api-core\nregistry=vintage-online\nserialization=simple\nprotocol=motan2\nversion=0.1\nrequestTimeout=1000\nhaStrategy=failover\nloadbalance=random\nfilter=accessLog,metrics\nmaxClientConnection=10\nminClientConnection=1\nretries=0\napplication=whos-agent\n\n[motan.refer.rpc_test]\ngroup=idevz-test-static\npath=com.weibo.motan.status\nregistry=consul-test-motan2\nprotocol=motan2\nserialization=simple\nbasicRefer=simple_rpc_ref\n```\n\n2. Start call\n\n```go\nlocal singletons = require \"motan.singletons\"\nlocal serialize = require \"motan.serialize.simple\"\nlocal client_map = singletons.client_map\nlocal client = client_map[\"rpc_test\"]\nlocal res = client:show_batch({name = \"idevz\"})\nprint_r(\"\u003cpre/\u003e\")\nprint_r(serialize.deserialize(res.body))\n```\n\n# Documents\n\n* [Wiki](https://github.com/weibocom/motan-go/wiki)\n* [Wiki(中文)](https://github.com/weibocom/motan-go/wiki/zh_overview)\n\n# Contributors\n\n* 周晶([@idevz](https://github.com/idevz))\n* Ray([@rayzhang0603](https://github.com/rayzhang0603))\n* xiaohutuer([@xiaohutuer](https://github.com/xiaohutuer))\n* Arthur Guo([@jealone](https://github.com/jealone))\n* huzhongx([@huzhongx](https://github.com/huzhongx))\n* dingzk([@dingzk](https://github.com/dingzk))\n\n# License\n\nMotan is released under the \n[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\n[motan]:https://github.com/weibocom/motan\n[consul]:http://www.consul.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweibocom%2Fmotan-openresty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweibocom%2Fmotan-openresty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweibocom%2Fmotan-openresty/lists"}