Skip to main content

Relaybus AMQP subscriber

Project description

relaybus-amqp (Python)

AMQP publisher and subscriber utilities for Relaybus.

Install

pip install relaybus-amqp

Example

from relaybus_amqp import (
    AmqpPublisher,
    AmqpPublisherConnectConfig,
    AmqpSubscriber,
    AmqpSubscriberConnectConfig,
)
from relaybus_core import OutgoingMessage

publisher = AmqpPublisher.connect(
    AmqpPublisherConnectConfig(url="amqp://guest:guest@localhost:5672/")
)
publisher.publish("relaybus.demo", OutgoingMessage(topic="relaybus.demo", payload=b"hello"))
publisher.close()

subscriber = AmqpSubscriber.connect(
    AmqpSubscriberConnectConfig(
        url="amqp://guest:guest@localhost:5672/",
        on_message=lambda msg: print(msg.topic, msg.payload),
    )
)
subscriber.start("relaybus.demo")
subscriber.close()

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

relaybus_amqp-0.0.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

relaybus_amqp-0.0.3-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file relaybus_amqp-0.0.3.tar.gz.

File metadata

  • Download URL: relaybus_amqp-0.0.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for relaybus_amqp-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b47a7a8f5ce244e8848f8a1ea644e81f1d6a8c4bfd19f5afdb5f0cd17d35bf61
MD5 e1702626059298a70fb0b54081fc1c68
BLAKE2b-256 3b811e1d5f2f18f5447d5e2a0b2830bb6bc370ed434ea31a1dd44a9ba759e320

See more details on using hashes here.

File details

Details for the file relaybus_amqp-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: relaybus_amqp-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for relaybus_amqp-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 341dfde4e8262fc16360bc5a0ece0578ff53e4e13892422db3105ebc1a2e1518
MD5 93c7a6b787a39079b572453bb6cd2154
BLAKE2b-256 5f1bb2b1a29144fb93e8f4818f06c6a782c6099501dcd21458e16f2efad25c05

See more details on using hashes here.

Supported by

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