{ "info": { "author": "SENSY Inc.", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "Pub/Sub Controller\n==================\n\nDescription\n-----------\n\nFetch the Subscription of the GCP Pub/Sub regularly, and if there is a\nmessage execute the script specified by the key in the message.\n\n\nGCP Pub/Sub\u306eSubscription\u3092\u5b9a\u671f\u7684\u306bFetch\u3057\u3001\n\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u3042\u308c\u3070\u30e1\u30c3\u30bb\u30fc\u30b8\u5185\u306e\u30ad\u30fc\u3067\u6307\u5b9a\u3055\u308c\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3002\n\nInstallation and Try to this sample.\n------------------------------------\n\n#. Create Pub/Sub topic and subscription on GCP. (ex: test-topic/test-sub)\n#. ``pip install pubsub_controller``\n#. ``pubsubcontroller init`` and input your Pub/Sub setting. (ex: GCP_PROJECT_ID=your project id / SUBSCRIPTION_ID=test-sub)\n#. ``pubsubcontroller subscribe``\n#. Subscriber will start immediately.\n#. Open Another Terminal Window.\n#. ``pubsubcontroller publish test-topic test-message '{\"target\":\"exec_sample\",\"text\":\"test_text\"}'``\n#. In the Subscriber\u2019s window you will see the contents of the message you just published!\n\nInstallation and Try to this sample.\n------------------------------------\n\n1. Create a new python file under \"exec_classes\" directory.\n\n - The same Python filename as the name specified by the attribute \"target\" key of the message to be published is executed.\n\n2. Implement ``def main (message_data, message_attr)`` and describe what you want to do after receiving the message.\n\n - \"message_data\" contains the contents of the received message.\n - \"message_attr\" contains optional attributes of the received message.\n\nDetails\n-------\n\n- Settings ``pubsub_controller/settings.py`` Required parameters are\n set here. (It is set automatically by the ``pubsubcontroller init`` command)\n\n - GCP PROJECT ID Your GCP ProjectID\n - SUBSCRIPTION ID Enter the Subscription ID to be used. If the\n Subscription name is ``projects/hoge-project/subscriptions/fuga``,\n please enter ``fuga``.\n - Interval Second Enter the interval to fetch Subscription in\n seconds.\n\n- Subscriber If you need a new subscriber, please refer to\n ``apps/subscriber/pull/exec_classes/exec_sample.py`` and create it.\n\n- Pull Subscriber This is a resident process that pulls Subscription.\n\n - config For reference, I am creating a supervisor config file.\n ``apps/subscriber/pull/config/pull_subscriber.ini``\n\n- Publisher Execute from the CLI or Python script and publish the\n message to the topic.\n\n - Exec on CommandLine\n\n - ``pubsubcontroller publish test test-message '{\"target\":\"exec_sample\",\"text\":\"test_text\"}'``\n\n - arguments\n\n - ``arg1 = topic name``\n - ``arg2 = message data``\n - ``arg3 = message attribute(json format)``\n\n - Exec on PythonCode\n\n .. code-block:: python\n\n from apps.publisher.publish_message import publish\n\n publish('test-topic', 'test_data', {'target':'exec_sample','text':'test_text'})\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/COLORFULBOARD/pubsub_controller", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "pubsub-controller", "package_url": "https://pypi.org/project/pubsub-controller/", "platform": "", "project_url": "https://pypi.org/project/pubsub-controller/", "project_urls": { "Homepage": "https://github.com/COLORFULBOARD/pubsub_controller" }, "release_url": "https://pypi.org/project/pubsub-controller/1.0.1/", "requires_dist": [ "google-cloud-pubsub (==0.30.1)", "Click (>=6.7)", "six (>=1.11.0)" ], "requires_python": "", "summary": "It provides a resident process that periodically pull subscribes and publish on CLI and Python.", "version": "1.0.1" }, "last_serial": 3718874, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e12348714b6f538566d1049bbafb319e", "sha256": "e09e69bda29d37656eb6f9efa48575875cdb2740f584a1f137ff8723352c602c" }, "downloads": -1, "filename": "pubsub_controller-1.0.0-py2.7.egg", "has_sig": false, "md5_digest": "e12348714b6f538566d1049bbafb319e", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 24374, "upload_time": "2018-03-30T04:00:47", "url": "https://files.pythonhosted.org/packages/68/2f/e688e54ac002679ca43a79794cb022c5e33c8a77bb7e00437c0a43b3dc91/pubsub_controller-1.0.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "f0656246d32a0895feeaa81b1203fd6d", "sha256": "d078dc4f156664e965862e298ad11b8835d8fbe26180290bcf31e9da9c82614f" }, "downloads": -1, "filename": "pubsub_controller-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "f0656246d32a0895feeaa81b1203fd6d", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14134, "upload_time": "2018-03-30T04:00:45", "url": "https://files.pythonhosted.org/packages/dc/29/0b485adaa361faa6816e11a6644109707fbc92ad91ee2b9489794a1dbdcf/pubsub_controller-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fc5c3d49af666137d0b390175beb970d", "sha256": "0707b7d2674325795af3fb1ef2f77456278e9a8fb5b46fe0a62a9f3b79bdcba4" }, "downloads": -1, "filename": "pubsub_controller-1.0.0.tar.gz", "has_sig": false, "md5_digest": "fc5c3d49af666137d0b390175beb970d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6627, "upload_time": "2018-03-30T04:00:48", "url": "https://files.pythonhosted.org/packages/cd/b9/8b7486deb20cc3299165a868d4eaaf5ad6824aaae09711e4d34087803688/pubsub_controller-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "b43780ebb711a5df6b2284be2dedaf11", "sha256": "c9f182deb3a6862335110053db42ba21fccd8f316c15bc3f7d1d183bc2b24d0c" }, "downloads": -1, "filename": "pubsub_controller-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "b43780ebb711a5df6b2284be2dedaf11", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14114, "upload_time": "2018-03-30T04:35:35", "url": "https://files.pythonhosted.org/packages/bb/97/04192c62e7184a99b79bce141e09aae8b74421095d3e512416751ec30308/pubsub_controller-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "af7e782b02a4b7d7a7263ab29c37fe53", "sha256": "bb26c4b0b875fea102818ad80c0e98ed48618629f7ab833f14002823fad09648" }, "downloads": -1, "filename": "pubsub_controller-1.0.1.tar.gz", "has_sig": false, "md5_digest": "af7e782b02a4b7d7a7263ab29c37fe53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6615, "upload_time": "2018-03-30T04:35:36", "url": "https://files.pythonhosted.org/packages/af/50/e322aa066c67425ef26ecc63e94e8c65b53dcd186f4678eb99089f518f5f/pubsub_controller-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b43780ebb711a5df6b2284be2dedaf11", "sha256": "c9f182deb3a6862335110053db42ba21fccd8f316c15bc3f7d1d183bc2b24d0c" }, "downloads": -1, "filename": "pubsub_controller-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "b43780ebb711a5df6b2284be2dedaf11", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14114, "upload_time": "2018-03-30T04:35:35", "url": "https://files.pythonhosted.org/packages/bb/97/04192c62e7184a99b79bce141e09aae8b74421095d3e512416751ec30308/pubsub_controller-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "af7e782b02a4b7d7a7263ab29c37fe53", "sha256": "bb26c4b0b875fea102818ad80c0e98ed48618629f7ab833f14002823fad09648" }, "downloads": -1, "filename": "pubsub_controller-1.0.1.tar.gz", "has_sig": false, "md5_digest": "af7e782b02a4b7d7a7263ab29c37fe53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6615, "upload_time": "2018-03-30T04:35:36", "url": "https://files.pythonhosted.org/packages/af/50/e322aa066c67425ef26ecc63e94e8c65b53dcd186f4678eb99089f518f5f/pubsub_controller-1.0.1.tar.gz" } ] }