Skip to main content

Python library for sending and receiving Eiffel events

Project description

Eiffellib is a python library for subscribing to and publishing Eiffel events to a message-broker.


Eiffellib solves the problem of publishing Eiffel events and subscribing to events, removing the need of knowing how to connect to a message-broker or how to utilize the protocol it supplies.

With Eiffellib you can start subscribing to and publish valid Eiffel messages quickly and to get a feel for the event protocol.

It is designed to be fast and easy to start using while still being production quality.



  • Simple subscription and publishing of Eiffel events.
  • Event building assistance with event validation on receive and publish.
  • Following a context link.


Install the project by running:

pip install eiffellib[rabbitmq]
If you only want to use the Eiffel message definitions leave out the optional dependency:
pip install eiffellib


Start RabbitMQ

In order for these examples to work you need a RabbitMQ server:

# From
docker run -d --hostname my-rabbit --name some-rabbit -p 8080:15672 -p 5672:5672 rabbitmq:3-management

Subscribing to an event

import time
from eiffellib.subscribers import RabbitMQSubscriber

def callback(event, context):

SUBSCRIBER = RabbitMQSubscriber(host="", port=5672, ssl=False,
                                queue="eiffel", exchange="amq.fanout")
SUBSCRIBER.subscribe("EiffelActivityTriggeredEvent", callback)
while True:

Publishing an event

from eiffellib.publishers import RabbitMQPublisher
from import EiffelActivityTriggeredEvent

PUBLISHER = RabbitMQPublisher(host="", exchange="amq.fanout", ssl=False,
                              port=5672, routing_key=None)
ACTIVITY_TRIGGERED = EiffelActivityTriggeredEvent()"name", "Test activity")

Deprecation of routing key

The “routing_key” argument in the RabbitMQPublisher class has been deprecated.

This deprecation also affects the default value of the “routing_key” argument and you will be getting warnings while running.

The reason for this change is due to a misunderstanding of how routing keys are supposed to be used when eiffellib was first created.

Each event will now be able to generate their own routing key every time the event is sent.

This routing key is by default “eiffel._.$event_type._._” where the different values are “eiffel.$family.$event_type.$tag.$domainid”.

Please refer to for more information about routing keys.

To change to the new routing key behavior (and thus removing the warning), please set “routing_key” to “None” when initializing a new RabbitMQPublisher.

PUBLISHER = RabbitMQPublisher(host="", exchange="amq.fanout", ssl=False,
                              port=5672, routing_key=None)

In order to change “$family”, “$tag” or “$domainid” in the routing key, they have to be set on the events.

PUBLISHER = RabbitMQPublisher(host="", exchange="amq.fanout", ssl=False,
                              port=5672, routing_key=None)
EVENT = EiffelActivityTriggeredEvent(family="myfamily", tag="mytag", domain_id="mydomain")


If you are having issues, please let us know. There is a mailing list at: or just write an Issue.

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

eiffellib-2.3.0.tar.gz (51.9 kB view hashes)

Uploaded source

Built Distribution

eiffellib-2.3.0-py2.py3-none-any.whl (182.2 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page