{"id":17030007,"url":"https://github.com/rob-blackbourn/jetblack-rabbitmqmon","last_synced_at":"2025-03-22T20:24:07.636Z","repository":{"id":62572357,"uuid":"256714955","full_name":"rob-blackbourn/jetblack-rabbitmqmon","owner":"rob-blackbourn","description":"A Python3 asyncio API for the RabbitMQ management plugin","archived":false,"fork":false,"pushed_at":"2020-05-24T08:51:05.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-08T10:02:54.754Z","etag":null,"topics":["aiohttp","aiohttp-client","asyncio","bareasgi","bareclient","python","python3","rabbitmq"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/rob-blackbourn.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":"2020-04-18T09:30:50.000Z","updated_at":"2022-06-06T19:55:37.000Z","dependencies_parsed_at":"2022-11-03T18:27:08.859Z","dependency_job_id":null,"html_url":"https://github.com/rob-blackbourn/jetblack-rabbitmqmon","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-blackbourn%2Fjetblack-rabbitmqmon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-blackbourn%2Fjetblack-rabbitmqmon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-blackbourn%2Fjetblack-rabbitmqmon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rob-blackbourn%2Fjetblack-rabbitmqmon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rob-blackbourn","download_url":"https://codeload.github.com/rob-blackbourn/jetblack-rabbitmqmon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245015634,"owners_count":20547442,"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":["aiohttp","aiohttp-client","asyncio","bareasgi","bareclient","python","python3","rabbitmq"],"created_at":"2024-10-14T08:03:24.159Z","updated_at":"2025-03-22T20:24:07.605Z","avatar_url":"https://github.com/rob-blackbourn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gascode-rabbitmqmon\n\nThis is an asyncio RabbitMQ monitor API for Python3.7+.\n\nIt wraps the RabbitMQ management plugin REST api. This allows retrieving\nmetrics and peeking into the queues.\n\n## Status\n\nThis is work in progress, but is functional.\n\n## Installation\n\nThis can be installed with pip.\n\nMultiple clients a supported and one *must* be selected. Choose one of:\n\n* [aiohttp](https://github.com/aio-libs/aiohttp)\n* [bareclient](https://github.com/rob-blackbourn/bareClient)\n\n```bash\npip install gascode-rabbitmqmon[bareclient]\n```\n\nOr alternatively:\n\n```bash\npip install gascode-rabbitmqmon[aiohttp]\n```\n\n\n## Usage\n\nThe following gets an overview using the bareclient.\n\n```python\nimport asyncio\nfrom gascode_rabbitmqmon.monitor import Monitor\nfrom gascode_rabbitmqmon.clients.bareclient_requester import BareRequester\n\nasync def main_async():\n    mon = Monitor(\n        BareRequester(\n            'http://mq.example.com:15672',\n            'admin',\n            'admins password'\n        )\n    )\n\n    overview = await mon.overview()\n    print(overview)\n\nif __name__ == '__main__':\n    asyncio.run(main_async())\n```\n\nThe follow explores a vhost using the aiohttp client.\n\n```python\nimport asyncio\nfrom gascode_rabbitmqmon.monitor import Monitor\nfrom gascode_rabbitmqmon.clients.aiohttp_requester import AioHttpRequester\n\nasync def main_async():\n    mon = Monitor(\n        AioHttpRequester(\n            'http://mq.example.com:15672',\n            'admin',\n            'admins password'\n        )\n    )\n\n    vhosts = await mon.vhosts()\n    for vhost in vhosts.values(): # vhost is a dict\n      exchanges = await vhost.exchanges()\n      for exchange in exchanges.values(): # exchanges is a dict\n          print(exchange)\n          # Objects can be refreshed to gather new metrics.\n          await exchange.refresh()\n          print(exchange)\n          bindings = await exchange.bindings()\n          for binding in bindings:\n              print(binding)\n\nif __name__ == '__main__':\n    asyncio.run(main_async())\n```\n\nThe following gets some messages from an exchange using the bareclient.\n\n```python\nimport asyncio\nfrom gascode_rabbitmqmon.monitor import Monitor\nfrom gascode_rabbitmqmon.clients.bareclient_requester import BareRequester\n\nasync def main_async():\n    mon = Monitor(\n        BareRequester(\n            'http://mq.example.com:15672',\n            'admin',\n            'admins password'\n        )\n    )\n\n    vhosts = await mon.vhosts()\n    vhost = vhosts['/some-vhost']\n    queues = await vhost.queues()\n    queue = queues['some.queue']\n    messages = await queue.get_messages()\n    print(messages)\n\nif __name__ == '__main__':\n    asyncio.run(main_async())\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob-blackbourn%2Fjetblack-rabbitmqmon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frob-blackbourn%2Fjetblack-rabbitmqmon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob-blackbourn%2Fjetblack-rabbitmqmon/lists"}