Skip to content

Commit 206b1e0

Browse files
007: base example, return value, multiple messages
1 parent 701d75f commit 206b1e0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

007/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Only `intelmqctl run` provides the ability to run bots interactively in the fore
99

1010
Starting IntelMQ bots using Python code requires a lot of effort (and code complexity). Additionally, the bot's parameters can only be provided by modifying the IntelMQ runtime configuration file, and messages can only be fed and retrieved from the bot by connecting to the pipeline (e.g.) separately and writing/reading properly serialized messages there.
1111

12+
Minimal example in pseudo code:
13+
```python
14+
bot_instance = Bot(parameters)
15+
bot_instance.process_message(input message) -> output messages
16+
```
17+
1218
## Requirements
1319

1420
### Messages and Pipeline
@@ -77,6 +83,14 @@ Return value is a list of messages sent by the bot.
7783
No exceptions of the bot are caught, the caller should handle them according to their needs.
7884
The bot does not dump any messages to files on errors, irrelevant of the bot's dumping configuration.
7985

86+
As bots can send messages to multiple queues, the return value is a dictionary of all destination queues.
87+
The items are lists, holding the sent messages.
88+
89+
#### Option: Processing multiple messages at once
90+
This is a more complex situation in regards to error handling.
91+
Should one exception stop the processing?
92+
Should the processing continue and the exceptions be saved in a variable, which is returned at the end together with the sent messages?
93+
8094
## Examples
8195

8296
### A

0 commit comments

Comments
 (0)