Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
######### Eiffellib #########
.. image:: https://img.shields.io/badge/Stage-Sandbox-yellow.svg :target: https://github.com/eiffel-community/community/blob/master/PROJECT_LIFECYCLE.md#stage-sandbox
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.
Documentation: https://eiffellib.readthedocs.io/en/latest/
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
In order for these examples to work you need a RabbitMQ server:
.. code-block::
docker run -d --hostname my-rabbit --name some-rabbit -p 8080:15672 -p 5672:5672 rabbitmq:3-management
.. code-block:: python
import time
from eiffellib.subscribers import RabbitMQSubscriber
def callback(event, context):
print(event.pretty)
SUBSCRIBER = RabbitMQSubscriber(host="127.0.0.1", port=5672, ssl=False,
queue="eiffel", exchange="amq.fanout")
SUBSCRIBER.subscribe("EiffelActivityTriggeredEvent", callback)
SUBSCRIBER.start()
while True:
time.sleep(0.1)
.. code-block:: python
from eiffellib.publishers import RabbitMQPublisher
from eiffellib.events import EiffelActivityTriggeredEvent
PUBLISHER = RabbitMQPublisher(host="127.0.0.1", exchange="amq.fanout", ssl=False,
port=5672, routing_key=None)
PUBLISHER.start()
ACTIVITY_TRIGGERED = EiffelActivityTriggeredEvent()
ACTIVITY_TRIGGERED.data.add("name", "Test activity")
PUBLISHER.send_event(ACTIVITY_TRIGGERED)
PUBLISHER.wait_for_unpublished_events()
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 https://eiffel-community.github.io/eiffel-sepia/rabbitmq-message-broker.html 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.
.. code-block:: python
PUBLISHER = RabbitMQPublisher(host="127.0.0.1", 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.
.. code-block:: python
PUBLISHER = RabbitMQPublisher(host="127.0.0.1", exchange="amq.fanout", ssl=False,
port=5672, routing_key=None)
EVENT = EiffelActivityTriggeredEvent(family="myfamily", tag="mytag", domain_id="mydomain")
PUBLISHER.send_event(EVENT)
If you are having issues, please let us know. There is a mailing list at: eiffel-pythonlib-maintainers@google-groups.com or just write an Issue.
FAQs
Python library for sending and receiving Eiffel events
We found that eiffellib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.