Pika-based event broker for publishing messages to RabbitMQ.
Initialise RabbitMQ event broker.
host- Pika host.
username- Username for authentication with Pika host.
password- Password for authentication with Pika host.
port- port of the Pika host.
queues- Pika queues to declare and publish to.
should_keep_unpublished_messages- Whether or not the event broker should maintain a queue of unpublished messages to be published later in case of errors.
raise_on_failure- Whether to raise an exception if publishing fails. If
False, keep retrying.
event_loop- The event loop which will be used to run
asyncio.get_event_loop()is used to get a loop.
connection_attempts- Number of attempts for connecting to RabbitMQ before an exception is thrown.
retry_delay_in_seconds- Time in seconds between connection attempts.
exchange_name- Exchange name to which the queues binds to. If nothing is mentioned then the default exchange name would be used.
Creates broker. See the parent class for more information.
Connects to RabbitMQ.
Closes connection to RabbitMQ.
True if a connection was established.
event to Pika queues.
event- Serialised event to be published.
headers- Message headers to append to the published message. The headers can be retrieved in the consumer from the
headersattribute of the message's
Get value of the
RASA_ENVIRONMENT environment variable.