Skip to main content

RabbitMQ event sender

Project description

eventsender

This is a simple event sender that publishes JSON-serialisable messages to an AMQP server exchange. It can also be optionally installed as a Django application.

Installation and configuration

The following settings should be supplied either as environment variables or via Django settings module:

EVENT_QUEUE_URL = os.environ.get('EVENT_QUEUE_URL')
EVENT_QUEUE_EXCHANGE = os.environ.get('EVENT_QUEUE_EXCHANGE')
EVENT_QUEUE_ROUTING_KEY = os.environ.get('EVENT_QUEUE_ROUTING_KEY', '')

EVENT_QUEUE_ROUTING_KEY is optional and can be omitted (it will be assumed blank by default).

Usage

Example:

from eventsender import send_event
send_event({'type': 'user.subscribed', 'username': 'john_doe'})

Or

EVENT_QUEUE_EXCHANGE=some_exchange EVENT_QUEUE_URL=amqp://guest:guest@localhost:5672/host python -c \
     "import eventsender; eventsender.send_event({'type': 'event_type', 'somedata': {'key': 'value'}})"

Running tests

Just run nosetests to run tests against your current setup.

About

This software is brought to you by Byte, a webhosting provider based in Amsterdam, The Netherlands. We specialize in fast and secure Magento hosting and scalable cluster hosting.

Check out our Github page for more open source software or our site to learn about our products and technologies. Looks interesting? Reach out about joining the team. Or just drop by for a cup of excellent coffee if you’re in town!

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

eventsender-1.1.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

eventsender-1.1.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file eventsender-1.1.3.tar.gz.

File metadata

  • Download URL: eventsender-1.1.3.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for eventsender-1.1.3.tar.gz
Algorithm Hash digest
SHA256 034ee135c2dcbdaa5eda825f71800db4c2e5c7c82054d63b1a8cc049aefa0a78
MD5 8c3955dcf2c11d289ea91119bb3b5d26
BLAKE2b-256 26cd378e7f32f13c7724fe24929e556f3eaff5b61b802acd0e7eb518ecd0265e

See more details on using hashes here.

File details

Details for the file eventsender-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: eventsender-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for eventsender-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3d7e31a6b9e8d00647ffa6faefae6701fc5e80b96a27c228972db856d85c990f
MD5 60064fff454f151077e85881e1a90f26
BLAKE2b-256 0e27229c94293f514fc16082a3fd9149cfcb9870b047677f30dba77919eb8409

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