activemq-api-client


Nameactivemq-api-client JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/TonySchneider/activemq-api-client
SummaryA Python client for ActiveMQ REST API
upload_time2023-08-31 23:16:07
maintainer
docs_urlNone
authorTony Schneider
requires_python
licenseMIT
keywords activemq api client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ActiveMQ API Client

An auxiliary Python client for the ActiveMQ REST API, designed to facilitate administrative and monitoring tasks, rather than replacing the native messaging protocols (STOMP, MQTT) for sending and receiving messages.

## Overview

ActiveMQ is a powerful open-source message broker that supports various messaging protocols like AMQP, MQTT, OpenWire, and WebSocket. While these protocols are recommended for regular message processing due to their efficiency, reliability, and feature set, there are certain administrative and monitoring tasks that can be efficiently handled using the ActiveMQ REST API. This Python client acts as a wrapper around the ActiveMQ REST API, providing developers and system administrators with a simple and convenient way to manage and monitor their ActiveMQ broker, queues, topics, and connections.

## Features

This package is designed to assist with the following administrative and monitoring tasks:

1. **Broker Status**: Check if the broker is running, its uptime, etc.
2. **Queue and Topic Monitoring**: Monitor the number of messages enqueued, dequeued, and the number of consumers connected.
3. **Connection Management**: Monitor the clients connected, their IP addresses, etc.
4. **Subscription Management**: Monitor the clients subscribed to various topics.

## Important Note

This package is not intended to replace the native messaging protocols (STOMP, MQTT, etc.) supported by ActiveMQ for sending and receiving messages. The REST API, and by extension this package, may not provide the same level of performance, scalability, reliability, and real-time updates as the native protocols. Therefore, it is recommended to use this package only for administrative and monitoring purposes, and to use the native messaging protocols for regular message processing in your application.

## Installation

Install the package via pip:

```
pip install activemq-api-client
```

## Usage

After installing the package, you can use it to interact with the ActiveMQ REST API.

```python
from activemq_api_client.client import ActiveMQClient

# Create an ActiveMQClient instance
client = ActiveMQClient('http://localhost:8161', 'admin', 'admin')

# Get details about all queues
queues = client.get_queues_details()
print(queues)

# Get the number of consumers connected to a specific queue
consumer_count = client.get_queue_consumer_count('exampleQueue')
print(consumer_count)

# Close the connection to the broker
client.close()
```

## Methods

The `ActiveMQClient` class provides the following methods to interact with the ActiveMQ REST API:

- `get_queues_details() -> List[dict]`

  Returns a list of dictionaries containing details about all the queues. Each dictionary contains the following keys:
    - `name`: The name of the queue.
    - `consumerCount`: The number of consumers connected to the queue.
    - `enqueueCount`: The number of messages enqueued in the queue.
    - `dequeueCount`: The number of messages dequeued from the queue.

- `get_queue_consumer_count(queue_name: str) -> Union[int, None]`

  Returns the number of consumers connected to the specified queue, or `None` if the queue does not exist.

- `get_queue_enqueue_count(queue_name: str) -> Union[int, None]`

  Returns the number of messages enqueued in the specified queue, or `None` if the queue does not exist.

- `get_queue_dequeue_count(queue_name: str) -> Union[int, None]`

  Returns the number of messages dequeued from the specified queue, or `None` if the queue does not exist.

- `get_connections_details() -> List[dict]`

  Returns a list of dictionaries containing details about all the connections. Each dictionary contains the following keys:
    - `clientId`: The client ID of the connection.
    - `remoteAddress`: The remote address of the connection.

- `get_topics_details() -> List[dict]`

  Returns a list of dictionaries containing details about all the topics. Each dictionary contains the following keys:
    - `name`: The name of the topic.
    - `consumerCount`: The number of consumers connected to the topic.
    - `enqueueCount`: The number of messages enqueued in the topic.

- `get_subscribers_details() -> List[dict]`

  Returns a list of dictionaries containing details about all the subscribers. Each dictionary contains the following keys:
    - `clientId`: The client ID of the subscriber.
    - `subscriptionName`: The subscription name of the subscriber.
    - `destinationName`: The destination name of the subscriber.

- `close()`

  Closes the connection to the ActiveMQ broker.

All methods except `close` send a GET request to the ActiveMQ REST API and return the response in the specified format. The `close` method does not send any request and simply closes the connection to the broker.


Closes the connection to the ActiveMQ broker.

## License

This package is released under the MIT License. See the `LICENSE` file for more details.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TonySchneider/activemq-api-client",
    "name": "activemq-api-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "activemq api client",
    "author": "Tony Schneider",
    "author_email": "tonysch05@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c2/79/e089efd9b75630edb19c51f5b08d8a98d4d134e5fcdd8676e32a67a65e2f/activemq-api-client-0.0.4.tar.gz",
    "platform": null,
    "description": "# ActiveMQ API Client\n\nAn auxiliary Python client for the ActiveMQ REST API, designed to facilitate administrative and monitoring tasks, rather than replacing the native messaging protocols (STOMP, MQTT) for sending and receiving messages.\n\n## Overview\n\nActiveMQ is a powerful open-source message broker that supports various messaging protocols like AMQP, MQTT, OpenWire, and WebSocket. While these protocols are recommended for regular message processing due to their efficiency, reliability, and feature set, there are certain administrative and monitoring tasks that can be efficiently handled using the ActiveMQ REST API. This Python client acts as a wrapper around the ActiveMQ REST API, providing developers and system administrators with a simple and convenient way to manage and monitor their ActiveMQ broker, queues, topics, and connections.\n\n## Features\n\nThis package is designed to assist with the following administrative and monitoring tasks:\n\n1. **Broker Status**: Check if the broker is running, its uptime, etc.\n2. **Queue and Topic Monitoring**: Monitor the number of messages enqueued, dequeued, and the number of consumers connected.\n3. **Connection Management**: Monitor the clients connected, their IP addresses, etc.\n4. **Subscription Management**: Monitor the clients subscribed to various topics.\n\n## Important Note\n\nThis package is not intended to replace the native messaging protocols (STOMP, MQTT, etc.) supported by ActiveMQ for sending and receiving messages. The REST API, and by extension this package, may not provide the same level of performance, scalability, reliability, and real-time updates as the native protocols. Therefore, it is recommended to use this package only for administrative and monitoring purposes, and to use the native messaging protocols for regular message processing in your application.\n\n## Installation\n\nInstall the package via pip:\n\n```\npip install activemq-api-client\n```\n\n## Usage\n\nAfter installing the package, you can use it to interact with the ActiveMQ REST API.\n\n```python\nfrom activemq_api_client.client import ActiveMQClient\n\n# Create an ActiveMQClient instance\nclient = ActiveMQClient('http://localhost:8161', 'admin', 'admin')\n\n# Get details about all queues\nqueues = client.get_queues_details()\nprint(queues)\n\n# Get the number of consumers connected to a specific queue\nconsumer_count = client.get_queue_consumer_count('exampleQueue')\nprint(consumer_count)\n\n# Close the connection to the broker\nclient.close()\n```\n\n## Methods\n\nThe `ActiveMQClient` class provides the following methods to interact with the ActiveMQ REST API:\n\n- `get_queues_details() -> List[dict]`\n\n  Returns a list of dictionaries containing details about all the queues. Each dictionary contains the following keys:\n    - `name`: The name of the queue.\n    - `consumerCount`: The number of consumers connected to the queue.\n    - `enqueueCount`: The number of messages enqueued in the queue.\n    - `dequeueCount`: The number of messages dequeued from the queue.\n\n- `get_queue_consumer_count(queue_name: str) -> Union[int, None]`\n\n  Returns the number of consumers connected to the specified queue, or `None` if the queue does not exist.\n\n- `get_queue_enqueue_count(queue_name: str) -> Union[int, None]`\n\n  Returns the number of messages enqueued in the specified queue, or `None` if the queue does not exist.\n\n- `get_queue_dequeue_count(queue_name: str) -> Union[int, None]`\n\n  Returns the number of messages dequeued from the specified queue, or `None` if the queue does not exist.\n\n- `get_connections_details() -> List[dict]`\n\n  Returns a list of dictionaries containing details about all the connections. Each dictionary contains the following keys:\n    - `clientId`: The client ID of the connection.\n    - `remoteAddress`: The remote address of the connection.\n\n- `get_topics_details() -> List[dict]`\n\n  Returns a list of dictionaries containing details about all the topics. Each dictionary contains the following keys:\n    - `name`: The name of the topic.\n    - `consumerCount`: The number of consumers connected to the topic.\n    - `enqueueCount`: The number of messages enqueued in the topic.\n\n- `get_subscribers_details() -> List[dict]`\n\n  Returns a list of dictionaries containing details about all the subscribers. Each dictionary contains the following keys:\n    - `clientId`: The client ID of the subscriber.\n    - `subscriptionName`: The subscription name of the subscriber.\n    - `destinationName`: The destination name of the subscriber.\n\n- `close()`\n\n  Closes the connection to the ActiveMQ broker.\n\nAll methods except `close` send a GET request to the ActiveMQ REST API and return the response in the specified format. The `close` method does not send any request and simply closes the connection to the broker.\n\n\nCloses the connection to the ActiveMQ broker.\n\n## License\n\nThis package is released under the MIT License. See the `LICENSE` file for more details.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python client for ActiveMQ REST API",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/TonySchneider/activemq-api-client"
    },
    "split_keywords": [
        "activemq",
        "api",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "34c448f75d2f4d878a5f3865de685777aa4c391879fec8a471fb24b47748cc3c",
                "md5": "457b85bde1870b466462ab45e678cf5a",
                "sha256": "a32f2e7772b6f5d95146fc718a04cda40a9923725241271b9866c529d15ee404"
            },
            "downloads": -1,
            "filename": "activemq_api_client-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "457b85bde1870b466462ab45e678cf5a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6653,
            "upload_time": "2023-08-31T23:16:05",
            "upload_time_iso_8601": "2023-08-31T23:16:05.521795Z",
            "url": "https://files.pythonhosted.org/packages/34/c4/48f75d2f4d878a5f3865de685777aa4c391879fec8a471fb24b47748cc3c/activemq_api_client-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c279e089efd9b75630edb19c51f5b08d8a98d4d134e5fcdd8676e32a67a65e2f",
                "md5": "2abc1f699d7277de0c69ae1a5e9a7bfd",
                "sha256": "881dfca85a872fd2e6b19f46abc07196d55b73b56c1ec510c64df5398b03afc7"
            },
            "downloads": -1,
            "filename": "activemq-api-client-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "2abc1f699d7277de0c69ae1a5e9a7bfd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5784,
            "upload_time": "2023-08-31T23:16:07",
            "upload_time_iso_8601": "2023-08-31T23:16:07.132572Z",
            "url": "https://files.pythonhosted.org/packages/c2/79/e089efd9b75630edb19c51f5b08d8a98d4d134e5fcdd8676e32a67a65e2f/activemq-api-client-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-31 23:16:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TonySchneider",
    "github_project": "activemq-api-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "activemq-api-client"
}
        
Elapsed time: 0.12529s