{"id":21831777,"url":"https://github.com/wuespace/telestion-extension-mongodb","last_synced_at":"2026-05-10T09:56:01.419Z","repository":{"id":36977107,"uuid":"391296324","full_name":"wuespace/telestion-extension-mongodb","owner":"wuespace","description":" A MongoDB connector for the Telestion backend","archived":false,"fork":false,"pushed_at":"2023-05-01T04:59:15.000Z","size":283,"stargazers_count":2,"open_issues_count":13,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-21T00:08:06.340Z","etag":null,"topics":["extension","mongo","mongo-client","mongodb","telestion","telestion-extension"],"latest_commit_sha":null,"homepage":"https://wuespace.github.io/telestion-extension-mongodb","language":"Java","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/wuespace.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-31T08:23:21.000Z","updated_at":"2021-12-22T03:16:39.000Z","dependencies_parsed_at":"2023-02-17T01:31:55.851Z","dependency_job_id":null,"html_url":"https://github.com/wuespace/telestion-extension-mongodb","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":"wuespace/telestion-extension-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Ftelestion-extension-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Ftelestion-extension-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Ftelestion-extension-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Ftelestion-extension-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wuespace","download_url":"https://codeload.github.com/wuespace/telestion-extension-mongodb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244804226,"owners_count":20513071,"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":["extension","mongo","mongo-client","mongodb","telestion","telestion-extension"],"created_at":"2024-11-27T19:15:32.454Z","updated_at":"2026-05-10T09:55:56.371Z","avatar_url":"https://github.com/wuespace.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# telestion-extension-mongodb\n\nA MongoDB connector for the Telestion backend.\n\n## Install\n\nFirst, add the extension package registry to your gradle repositories:\n\n```groovy\nrepositories {\n    maven {\n        name = \"GitHubMongoDB\"\n        url = uri(\"https://maven.pkg.github.com/wuespace/telestion-extension-mongodb/\")\n        credentials {\n            username = System.getenv(\"GITHUB_ACTOR\") == null ? GITHUB_ACTOR : System.getenv(\"GITHUB_ACTOR\")\n            password = System.getenv(\"GITHUB_TOKEN\") == null ? GITHUB_TOKEN : System.getenv(\"GITHUB_TOKEN\")\n        }\n    }\n}\n```\n\nNext, add the extension to the project dependency list:\n\n```groovy\ndependencies {\n    // ...\n    implementation 'de.wuespace.telestion.extension:mongodb:0.1.0'\n    // ...\n}\n```\n\nAnd synchronize gradle.\n\nFinished!\n\n## Usage\n\nThe extension provides different verticles, that you can use and set up in your project `config.json`.\nYou will need at least the\n[MongoDatabaseService](https://wuespace.github.io/telestion-extension-mongodb/de/wuespace/telestion/extension/mongodb/MongoDatabaseService.html)\nverticle to communicate with the Mongo-Database.\n\nA really simple configuration could look like:\n```json\n{\n  \"org.telestion.configuration\": {\n    \"app_name\": \"Basic Example\",\n    \"verticles\": [\n      {\n        \"name\": \"Mongo Database Service\",\n        \"verticle\": \"de.wuespace.telestion.extension.mongodb.MongoDatabaseService\",\n        \"magnitude\": 1,\n        \"config\": {\n          \"host\": \"mongodb\"\n        }\n      }\n    ]\n  }\n}\n```\n\nwith the `host` property specifying the hostname or ip address of the host machine running the mongo database.\n\nNow, you can extend your configuration to store and request data from the database.\n\nYou can use the\n[DataListener](https://wuespace.github.io/telestion-extension-mongodb/de/wuespace/telestion/extension/mongodb/DataListener.html)\nverticle to listen to specific eventbus addresses and insert incoming messages into the database.\n\nFor example:\n\n```json\n{\n  \"org.telestion.configuration\": {\n    \"app_name\": \"Basic Example\",\n    \"verticles\": [\n      {\n        \"name\": \"Data Listener\",\n        \"verticle\": \"de.wuespace.telestion.extension.mongodb.DataListener\",\n        \"magnitude\": 1,\n        \"config\": {\n          \"listeningAddresses\": [\n            \"example-data\"\n          ]\n        }\n      },\n      {\n        \"name\": \"Mongo Database Service\",\n        \"verticle\": \"de.wuespace.telestion.extension.mongodb.MongoDatabaseService\",\n        \"magnitude\": 1,\n        \"config\": {\n          \"host\": \"mongodb\"\n        }\n      }\n    ]\n  }\n}\n```\n\nThis configuration deploys a verticle which listens on the eventbus address `example-data`\nand stores all incoming messages into the registered mongo database.\nEvery message type obtains its **own collection** in mongo.\nTo access the collections, use the full classname of the message type.\n\nTo extract data in periodic intervals, you can use the\n[PeriodicDataAggregator](https://wuespace.github.io/telestion-extension-mongodb/de/wuespace/telestion/extension/mongodb/PeriodicDataAggregator.html)\nverticle. It requests data in regular intervals,\ncombines them in a predefined format into one message\nand sends it on the specified eventbus address.\n\nFor example:\n\n```json\n{\n  \"org.telestion.configuration\": {\n    \"app_name\": \"Basic Example\",\n    \"verticles\": [\n      {\n        \"name\": \"Mongo Database Service\",\n        \"verticle\": \"de.wuespace.telestion.extension.mongodb.MongoDatabaseService\",\n        \"magnitude\": 1,\n        \"config\": {\n          \"host\": \"mongodb\"\n        }\n      },\n      {\n        \"name\": \"Periodic Data Aggregator\",\n        \"verticle\": \"de.wuespace.telestion.extension.mongodb.PeriodicDataAggregator\",\n        \"magnitude\": 1,\n        \"config\": {\n          \"collection\": \"de.wuespace.telestion.project.daedalus2.messages.SystemT\",\n          \"field\": \"imu.acc.x\",\n          \"rate\": 10,\n          \"outAddress\": \"aggregated-imu.acc.x\"\n        }\n      }\n    ]\n  }\n}\n```\n\nHere the `PeriodicDataAggregator` looks for a collection storing the `SystemT` message type\nand tries to extract the `imu.acc.x` property which can be deeply nested.\nAfter it gathered all required information, it publishes the data onto the `aggregated-imu.acc.x` eventbus address.\nYou can configure the aggregation rate via the `rate` property. The rate is represented as aggregations per second.\n\n## Setup MongoDB\n\nIf you use our [Project Template](https://github.com/wuespace/telestion-project-template),\nyou can easily add MongoDB to your build and deploy pipeline.\n\nOpen the `docker-compose.yml` in the `application` folder and add the `mongodb` service:\n\n```yaml\nversion: \"3.9\"\n\nservices:\n  mongodb:\n    # most recent and stable version off mongodb\n    image: \"mongo:4\"\n    profiles: [\"devel-native\", \"devel-docker\", \"prod\"]\n    restart: always\n    ports:\n      # passthrough mongodb listen port to host for debugging\n      - \"127.0.0.1:27017:27017\"\n    volumes:\n      # store database data for a later restart\n      - type: volume\n        source: mongodb-data\n        target: \"/data/db\"\n    # environment:\n    #   # mongodb authentication\n    #   MONGO_INITDB_ROOT_USERNAME: 'root'\n    #   MONGO_INITDB_ROOT_PASSWORD: '12345'\n    # bind to open ip to allow incoming connections from other network devices\n    command: \"--bind_ip 0.0.0.0\"\n\n  telestion-devel:\n    image: \"telestion-devel\"\n    profiles: [\"devel-docker\"]\n    # ...\n```\n\nDo not forget to also update the `production.yml`:\n\n```yaml\nversion: \"3.7\"\n\nservices:\n  mongodb:\n    # most recent and stable version off mongodb\n    image: \"mongo:4\"\n    restart: always\n    ports:\n      # passthrough mongodb listen port to host for debugging\n      - \"127.0.0.1:27017:27017\"\n    volumes:\n      # store database data for a later restart\n      - type: volume\n        source: mongodb-data\n        target: \"/data/db\"\n    # environment:\n    #   # mongodb authentication\n    #   MONGO_INITDB_ROOT_USERNAME: 'root'\n    #   MONGO_INITDB_ROOT_PASSWORD: '12345'\n    # bind to open ip to allow incoming connections from other network devices\n    command: \"--bind_ip 0.0.0.0\"\n\n  telestion:\n    image: \"ghcr.io/wuespace/telestion-project-daedalus2:latest\"\n    restart: always\n    # ...\n```\n\n### Contributing\n\nFor the documentation on contributing to this repository,\nplease take a look at the [Contributing Guidelines](./CONTRIBUTING.md).\n\n## About\n\nThis is part of [Telestion](https://telestion.wuespace.de/), a project by [WüSpace e.V.](https://www.wuespace.de/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuespace%2Ftelestion-extension-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwuespace%2Ftelestion-extension-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuespace%2Ftelestion-extension-mongodb/lists"}