Categories:
Aura Bot middlewares
Description of the different Aura Bot middlewares, components in charge of the messages flow
Introduction to Aura Bot middlewares
Middlewares in aura-bot are software components in charge of the messages flow. In fact, they are just classes executed between the bot adapter and aura-bot logic.
Middlewares are defined by Microsoft BotFramework, thus Aura just adds as many middlewares as needed in order to make the bot handle messages appropriately.
Find here further information about middlewares in BotFramework.
There are two types of middlewares defined in aura-bot:
- Middlewares that are always executed following a specific order established by the bot.
- Middlewares that are optional and are activated by configuration, through the environment variable
AURA_ACTIVE_MIDDLEWARES.
The following figure schematically shows the aura-bot middlewares flow for messages, indicating their category and the orderly execution of all of them.
| Classification criteria | Categories |
|---|---|
| When they are executed | - INPUT (turquoise): if they are an input to aura-bot, in order to summon a dialog. - OUTPUT (orange): they are an output from aura-bot, leading to the output message generation. - INPUT-OUTPUT: (half turquoise/half orange), if they have methods to be run before executing the dialog and methods to be executed after it. |
| Mandatory / optional | - M: mandatory - O: optional |
| Execution mode: flow stops when middleware fails | - False: Execution flow stops when middleware fails - True: execution continues when middleware fails |
To configure the optional middlewares, they should be added to the environment variable AURA_ACTIVE_MIDDLEWARES that should contain the name/s of the needed optional middlewares. It should contain a comma separated list with all or a set of the following names:
- batch-outgoing-message-middleware
- speak-processor-middleware