anyblok_bus.bloks.bus.
Bus
(registry)Bases: anyblok.blok.Blok
Add bus configuration in AnyBlok
author
= 'Suzanne Jean-Sébastien'conditional_by
= []conflicting_by
= []import_declaration_module
()Do the python import for the Declaration of the model or other
name
= 'bus'optional_by
= []reload_declaration_module
(reload)required
= ['anyblok-core']required_by
= []version
= '1.0.0'This blok define two Models:
anyblok_bus.bloks.bus.bus.
Bus
Bases: object
Namespace Bus
AnyBlok registration:
get_consumers
()Return the list of the consumers
publish
(exchange, routing_key, data, contenttype)Publish a message in an exchange with a routing key through rabbitmq with the profile given by the anyblok configuration
Parameters: |
|
---|---|
Exception: | PublishException |
anyblok_bus.bloks.bus.profile.
Profile
Bases: object
AnyBlok registration:
Fields | |
---|---|
description |
|
state |
|
url |
|
name |
|
anyblok_bus.bloks.bus.message.
Message
Bases: object
AnyBlok registration:
Fields | |
---|---|
queue |
|
id |
|
sequence |
|
content_type |
|
message |
|
error |
|
method |
|
model |
|
consume
()Try to consume on message to import it in database
consume_all
()Try to consume all the message, ordered by the sequence
anyblok_bus.bloks.bus.exceptions.
PublishException
Bases: Exception
Exception Error for Publish a message through rabbitmq