Skip to main content

Uma biblioteca para facilitar as configurações de RabbitMQ

Project description

RabbitMQ Helper RabbitMQ Helper é uma biblioteca Python simples e poderosa para facilitar a configuração e o uso do RabbitMQ em seus projetos. Ela abstrai a complexidade de lidar diretamente com a API do RabbitMQ, fornecendo uma interface clara para gerenciar conexões, filas e publicações de mensagens.

Recursos Gerenciamento de Conexões: Crie e gerencie conexões com o RabbitMQ de maneira fácil e configurável. Manipulação de Filas: Crie, vincule e consuma mensagens de filas com métodos simples. Publicação de Mensagens: Publique mensagens de forma persistente em filas e exchanges do RabbitMQ. Instalação Instale a biblioteca usando pip:

pip install rabbitmq-helper

Como Usar Conectando ao RabbitMQ from rabbitmq_helper.connection import RabbitMQConnection

# Conectar ao RabbitMQ com parâmetros personalizados
conn = RabbitMQConnection(host='localhost', port=5672, username='guest', password='guest')
conn.connect()

# Fechar a conexão
conn.close()

Trabalhando com Filas from rabbitmq_helper.queue import RabbitMQQueue

# Configurar a fila
queue = RabbitMQQueue(conn.channel)
queue.declare_queue('minha_fila')

Consumir mensagens

def callback(ch, method, properties, body):
    print("Mensagem recebida: %r" % body)

queue.consume('minha_fila', callback)

Publicando Mensagens Persistentes from rabbitmq_helper.publisher import RabbitMQPublisher

# Publicar uma mensagem persistente
publisher = RabbitMQPublisher(conn.channel)
publisher.publish('', 'minha_fila', 'Mensagem persistente no RabbitMQ!')

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

rabbitmq_helper-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

rabbitmq_helper-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file rabbitmq_helper-0.1.0.tar.gz.

File metadata

  • Download URL: rabbitmq_helper-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for rabbitmq_helper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0c0024d3323d8e7242aece94c962020e038fc82e7ed8acb17dc913e394393b66
MD5 a5e009b93639015383ed7f9998945084
BLAKE2b-256 51e2d9114478f5339abdcca54bf064ee1105857695d2cdac4c1ce53e8f2054b2

See more details on using hashes here.

File details

Details for the file rabbitmq_helper-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rabbitmq_helper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acd44d51f4f31465c1fc979082dd0b3cc82214e631ccf65d742b21d9328880f6
MD5 6625507068bbdb608d3889bd0309b89f
BLAKE2b-256 8cc25dd0bcfa1911e98c20a79467b0b121b1b8a81e2a25065dde86417d538aed

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