Skip to main content

Python Rabbit wrapper library to simplify to use Exchanges and Queues with decorators

Project description

Hijiki

Python Rabbit wrapper library to simplify to use Exchanges and Queues with decorators

Configurations

Hijiki uses environment variables to configure connection with BROKER.

  • BROKER_PORT
  • BROKER_PWD
  • BROKER_USERNAME
  • BROKER_SERVER

If server is not present the connection url will be a default, and to others configs will be changed for "teste".

How to use

Publisher

The example demonstrate how to publish a simple message to topic "teste1_event" with a json message:

pub = Publisher()
pub.publish_message('teste1_event', '{"value": "Esta é a mensagem"}')

Consumer

Consumer uses a configuration to define QUEUES and Exchanges and the consumer is a decorator for the queue.

from hijiki.broker.hijiki_rabbit import HijikiQueueExchange, HijikiRabbit

qs = [HijikiQueueExchange('teste1', 'teste1_event'), HijikiQueueExchange('teste2', 'teste2_event')]
gr = HijikiRabbit(qs)

class MyConsumer():
    @gr.task(queue_name='teste1')
    def my_consumer(self):
        print("consumer 1 executed")

    @gr.task(queue_name='teste2')
    def my_consumer2(self):
        print("consumer 2 executed")

if __name__ == '__main__':
    MyConsumer()
    gr.run()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hijiki-0.0.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

hijiki-0.0.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file hijiki-0.0.0.tar.gz.

File metadata

  • Download URL: hijiki-0.0.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for hijiki-0.0.0.tar.gz
Algorithm Hash digest
SHA256 67cc202bd0c8ee8b90be078a0f45ba87a09861e6efd8dc749345feedbe6629cb
MD5 2a7aafe10fa7376040d0cb169218348f
BLAKE2b-256 a8a72d358ea0e40d5aeb878f8261b63d168ec2c0ca85859af8df21eb5d64460e

See more details on using hashes here.

File details

Details for the file hijiki-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: hijiki-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for hijiki-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc54ac2a4faaa2f1643956c907c516a71fd99055eb16994235b47a1cf0ce424
MD5 0aefadd9c1364c5983a4cb213e232d3c
BLAKE2b-256 f05ee077405ac672c059b56b98263c1114a1c351897f7aaaf52a52ae5f589d94

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page