swarm-bus


Nameswarm-bus JSON
Version 5.18 PyPI version JSON
download
home_pagehttps://bitbucket.org/monalgroup/swarm-bus
SummaryESB SQS based
upload_time2022-12-14 12:29:14
maintainer
docs_urlNone
authorThe Swarm Team
requires_python
licenseGPL License
keywords esb tools swarm bus
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Swarm-Bus
=========

Client side implementation of an ESB with Amazon SQS.

Simple Usage
------------

::

    # Default transport config
    transport = {
        'prefix': 'dev-%(hostname)s-',
        'priorities': ['low', 'medium', 'high'],
        'polling_interval': 20,                   # Default queue polling interval
        'retention_period': 864000,               # Default queue retention period
        'visibility_timeout': 30,                 # Default queue visibility timeout
        'sleep_time': 0,                          # Default queue sleep time
        'region': 'eu-west-1'
    }

    bus = SwarmBus('LOGIN', 'PASSWORD', **transport)
    bus.connect()

    queue_config = {
        'visibility_timeout': 5
    }

    # Now we register a new queue
    bus.register_queue('new_queue', **queue_config)

    # Disconnect the bus to finish
    bus.disconnect()


Using as a producer
-------------------

::

    with SwarmBus('LOGIN', 'PASSWORD', **transport) as producer:
        producer.register_queue('new_queue')

        producer.publish(
            'new_queue',
            {'id': 42}
        )

        producer.publish(
            'new_queue',
            {'id': 84},
            priority=1,  # Priority index, correspond to 'medium'
            delay=5      # Delay of the message
        )


Using as a consumer
-------------------

::

    def handle_message(body, message):
        print(body)
        message.delete()

    def error_handler(body, message):
        raise ValueError('Error while processing message')

    with SwarmBus('LOGIN', 'PASSWORD', **transport) as consumer:
        consumer.register_queue('new_queue')

        consumer.consume(
            'new_queue',
            handle_message,
            error_handler
        )



            

Raw data

            {
    "_id": null,
    "home_page": "https://bitbucket.org/monalgroup/swarm-bus",
    "name": "swarm-bus",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ESB,tools,swarm,bus",
    "author": "The Swarm Team",
    "author_email": "dev@hiventy.com",
    "download_url": "https://files.pythonhosted.org/packages/d0/d2/9005e3f13cddf9b36315de7ec575fb3639bcb189d0467e556df4b41c1a55/swarm-bus-5.18.tar.gz",
    "platform": null,
    "description": "Swarm-Bus\n=========\n\nClient side implementation of an ESB with Amazon SQS.\n\nSimple Usage\n------------\n\n::\n\n    # Default transport config\n    transport = {\n        'prefix': 'dev-%(hostname)s-',\n        'priorities': ['low', 'medium', 'high'],\n        'polling_interval': 20,                   # Default queue polling interval\n        'retention_period': 864000,               # Default queue retention period\n        'visibility_timeout': 30,                 # Default queue visibility timeout\n        'sleep_time': 0,                          # Default queue sleep time\n        'region': 'eu-west-1'\n    }\n\n    bus = SwarmBus('LOGIN', 'PASSWORD', **transport)\n    bus.connect()\n\n    queue_config = {\n        'visibility_timeout': 5\n    }\n\n    # Now we register a new queue\n    bus.register_queue('new_queue', **queue_config)\n\n    # Disconnect the bus to finish\n    bus.disconnect()\n\n\nUsing as a producer\n-------------------\n\n::\n\n    with SwarmBus('LOGIN', 'PASSWORD', **transport) as producer:\n        producer.register_queue('new_queue')\n\n        producer.publish(\n            'new_queue',\n            {'id': 42}\n        )\n\n        producer.publish(\n            'new_queue',\n            {'id': 84},\n            priority=1,  # Priority index, correspond to 'medium'\n            delay=5      # Delay of the message\n        )\n\n\nUsing as a consumer\n-------------------\n\n::\n\n    def handle_message(body, message):\n        print(body)\n        message.delete()\n\n    def error_handler(body, message):\n        raise ValueError('Error while processing message')\n\n    with SwarmBus('LOGIN', 'PASSWORD', **transport) as consumer:\n        consumer.register_queue('new_queue')\n\n        consumer.consume(\n            'new_queue',\n            handle_message,\n            error_handler\n        )\n\n\n",
    "bugtrack_url": null,
    "license": "GPL License",
    "summary": "ESB SQS based",
    "version": "5.18",
    "split_keywords": [
        "esb",
        "tools",
        "swarm",
        "bus"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "c3d9d1b58275d0d0e279a177e15f8400",
                "sha256": "2769428d29ceb2694b316185c00a9735af71abc146efe787871d9975d126b4fc"
            },
            "downloads": -1,
            "filename": "swarm_bus-5.18-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c3d9d1b58275d0d0e279a177e15f8400",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9088,
            "upload_time": "2022-12-14T12:29:12",
            "upload_time_iso_8601": "2022-12-14T12:29:12.442551Z",
            "url": "https://files.pythonhosted.org/packages/f6/e6/01fe536334d8f7ce1d8653231727f1659b1caa7cdf81f4500b9510995347/swarm_bus-5.18-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "ee1a808e5f519fe71971521bb33fe5c0",
                "sha256": "65b54ed607eec86457666afeb940e7148198a76359be780ca12e2f4df9a765a7"
            },
            "downloads": -1,
            "filename": "swarm-bus-5.18.tar.gz",
            "has_sig": false,
            "md5_digest": "ee1a808e5f519fe71971521bb33fe5c0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7419,
            "upload_time": "2022-12-14T12:29:14",
            "upload_time_iso_8601": "2022-12-14T12:29:14.686848Z",
            "url": "https://files.pythonhosted.org/packages/d0/d2/9005e3f13cddf9b36315de7ec575fb3639bcb189d0467e556df4b41c1a55/swarm-bus-5.18.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-14 12:29:14",
    "github": false,
    "gitlab": false,
    "bitbucket": true,
    "bitbucket_user": "monalgroup",
    "bitbucket_project": "swarm-bus",
    "lcname": "swarm-bus"
}
        
Elapsed time: 0.05629s