{"id":13447148,"url":"https://github.com/dot-microservices/dot-bee","last_synced_at":"2025-03-21T17:30:54.017Z","repository":{"id":57215310,"uuid":"198626060","full_name":"dot-microservices/dot-bee","owner":"dot-microservices","description":null,"archived":true,"fork":false,"pushed_at":"2019-12-01T06:59:50.000Z","size":260,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-12T09:17:55.849Z","etag":null,"topics":["bee-queue","concurrency","fault-tolerance","microservice-framework","microservice-toolkit","microservices","rpc","service-discovery","soa"],"latest_commit_sha":null,"homepage":"https://github.com/umuplus/beems","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dot-microservices.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":"2019-07-24T11:54:02.000Z","updated_at":"2023-01-28T16:17:15.000Z","dependencies_parsed_at":"2022-08-24T21:50:15.744Z","dependency_job_id":null,"html_url":"https://github.com/dot-microservices/dot-bee","commit_stats":null,"previous_names":["dvs-bilisim/dot-bee"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dot-microservices%2Fdot-bee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dot-microservices%2Fdot-bee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dot-microservices%2Fdot-bee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dot-microservices%2Fdot-bee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dot-microservices","download_url":"https://codeload.github.com/dot-microservices/dot-bee/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244752569,"owners_count":20504316,"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","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":["bee-queue","concurrency","fault-tolerance","microservice-framework","microservice-toolkit","microservices","rpc","service-discovery","soa"],"created_at":"2024-07-31T05:01:09.431Z","updated_at":"2025-03-21T17:30:53.704Z","avatar_url":"https://github.com/dot-microservices.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# dot-bee\n\na bee-queue based minimalist toolkit for building fast, decentralized, scalable and fault tolerant microservices\n\n## Motivation\n\nmajor difference from other [dot-rest](https://github.com/Dvs-Bilisim/dot-rest) or\n[dot-ws](https://github.com/Dvs-Bilisim/dot-ws) projects is that\nit works on top of a redis-based solid message queue called [bee-queue](https://github.com/bee-queue/bee-queue).\nbecause of that, [clerq](https://github.com/Dvs-Bilisim/clerq) based service discovery is out of the architecture.\n\non the other hand, original [dot](https://github.com/Dvs-Bilisim/dot) has auto service discovery feature and\nbecause of its dependencies, it has completely different use cases.\n\n## Install\n\n```bash\nnpm i --save dot-bee\n```\n\nYou can also clone this repository and make use of it yourself.\n\n```bash\ngit clone https://github.com/Dvs-Bilisim/dot-bee.git\ncd dot-bee\nnpm i\nnpm test\n```\n\nBefore running tests, please make sure that you have Redis available on localhost.\nIf you don't know how to do that temporarily, please use following command to run it via docker.\n\n```bash\ndocker run -p 6379:6379 --name dot_redis redis:4-alpine\n```\n\n## Configuration\n\n- **bee:** options for initializing a bee queue instance. please see more details at [Bee Queue Settings](https://github.com/bee-queue/bee-queue#settings).\n- **job:** options for creating a bee queue job. only setId, retries, backoff, delayUntil and timeout methods allowed. please see more details at [Bee Queue Job Settings](https://github.com/bee-queue/bee-queue#methods-1).\n- **pino:** options for pino logger. it's { \"level\": \"error\" } by default.\n\n## Server Methods\n\n- **.addServices(services, concurrency = 1, options):** adds list of services and automatically creates their queues and consumers\n- **.addService(service, concurrency = 1, options):** adds a new service and automatically creates related queue and its consumer\n- **.close():** stops all existing queues for a clean shutdown\n- **.destroy():** removes everything about existing queues from redis\n\n## Client Methods\n\n- **.acceptServices(services, options):** accepts existing services to send jobs\n- **.acceptService(service, options):** accepts an existing service to send jobs\n- **.forward(service, method, data, options):** sends a new job to an existing service\n- **.send(service, method, data, options):** sends a new job to an existing service and retrieves its response\n- **.close():** stops all existing queues for a clean shutdown\n\n## Examples\n\n```js\nconst { Client, Server } = require('dot-bee');\n\nclass Service {\n    static _name() {\n        return 'myService';\n    }\n\n    static async echo(job) {\n        return job.data;\n    }\n}\n\nconst client = new Client();\nconst server = new Server();\nserver.addServices([ Service ]);\nclient.acceptServices([ 'myService' ]);\n\nconst r = await client.send('test', 'echo', { t: Date.now() });\nconsole.log(r);\n\nawait client.close();\nawait server.destroy();\nawait server.close();\n```\n\n## Optional Job Configuration\n\nplease see more details at [Bee Queue Job Settings](https://github.com/bee-queue/bee-queue#methods-1).\n\n```js\nawait client.send('test', 'echo', { t: Date.now() }, {\n    setId: 'my-custom-job-id',\n    retries: 2,\n    backoff: [ 'fixed', 1000 ],\n    delayUntil: Date.parse('2082-08-23T00:00:01.000Z'),\n    timeout: 10000\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdot-microservices%2Fdot-bee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdot-microservices%2Fdot-bee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdot-microservices%2Fdot-bee/lists"}