|
|
@@ -169,3 +169,34 @@ with Diagram("Stateful Architecture", show=False): |
|
|
|
``` |
|
|
|
|
|
|
|
![stateful architecture diagram](/img/stateful_architecture_diagram.png) |
|
|
|
|
|
|
|
## RabbitMQ Consumers with custom nodes |
|
|
|
|
|
|
|
```python |
|
|
|
from urllib.request import urlretrieve |
|
|
|
|
|
|
|
from diagrams import Cluster, Diagram |
|
|
|
from diagrams.custom import Custom |
|
|
|
from diagrams.aws.database import Aurora |
|
|
|
from diagrams.k8s.compute import Pod |
|
|
|
|
|
|
|
# Download an image to be used into a Custom Node class |
|
|
|
rabbitmq_url = "https://jpadilla.github.io/rabbitmqapp/assets/img/icon.png" |
|
|
|
rabbitmq_icon = "rabbitmq.png" |
|
|
|
urlretrieve(rabbitmq_url, rabbitmq_icon) |
|
|
|
|
|
|
|
|
|
|
|
with Diagram("Broker Consumers", show=False): |
|
|
|
with Cluster("Consumers"): |
|
|
|
consumers = [ |
|
|
|
Pod("worker"), |
|
|
|
Pod("worker"), |
|
|
|
Pod("worker") |
|
|
|
] |
|
|
|
|
|
|
|
queue = Custom("Message queue", rabbitmq_icon) |
|
|
|
|
|
|
|
queue >> consumers >> Aurora("Database") |
|
|
|
```` |
|
|
|
|
|
|
|
![rabbitmq consumers diagram](/img/rabbitmq_consumers_diagram.png) |