Skip to content

Commit 07fd9dc

Browse files
authored
Enhance ACA and Artemis integration documentation
Added an overview of how Azure Container Apps and ActiveMQ Artemis work together, including roles, functionality, and a Java example for message production.
1 parent 851f919 commit 07fd9dc

1 file changed

Lines changed: 97 additions & 0 deletions

File tree

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# How ACA + Artemis Work Together - Overview
2+
3+
> Big picture summary so you can see how Azure Container Apps (ACA) fits with ActiveMQ Artemis for a broker + quorum voter setup.
4+
5+
Costa Rica
6+
7+
[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com)
8+
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
9+
[brown9804](https://github.com/brown9804)
10+
11+
Last updated: 2025-10-23
12+
13+
----------
14+
15+
> Big picture: `ActiveMQ Artemis provides the messaging and HA logic; Azure Container Apps provides the resilient execution platform`
16+
> - `Artemis` is the brain: `It knows how to broker messages, enforce HA, and use voters to stay consistent.`
17+
> - `ACA` is the body: `It runs those brokers and voters in a resilient, elastic, cloud‑native environment.`
18+
> - Together: `You get a geo‑redundant, fault‑tolerant messaging backbone where failover is decided by quorum voters, and ACA ensures the containers are always healthy, distributed, and secure.`
19+
20+
<details>
21+
<summary><b>List of References</b> (Click to expand)</summary>
22+
23+
- [Use a split-brain DNS configuration to host a web app in Azure](https://learn.microsoft.com/en-us/azure/architecture/example-scenario/networking/split-brain-dns)
24+
25+
</details>
26+
27+
`Artemis is infrastructure, not a coding framework. You code against its APIs, but the broker itself runs as a service.`
28+
29+
- You **run Artemis brokers** in Azure Container Apps, and if neeeded you can add other data centers.
30+
- Your **application code** connects to these brokers using JMS/AMQP/etc.
31+
- **Quorum voters** (also running in Azure or other sites) decide which broker should be live during failures.
32+
- Your app doesn’t need to know which broker is live, the client libraries handle failover automatically if configured correctly.
33+
34+
35+
## Overview
36+
37+
1. ActiveMQ Artemis role:
38+
- Broker = messaging server: `Receives, stores, and forwards messages between producers and consumers.`
39+
- HA model: `Brokers run in live/backup pairs, with quorum voters deciding who is live to prevent split‑brain.`
40+
- Cluster option: `Multiple brokers can form a cluster for load balancing and redundancy.`
41+
2. Quorum voters:
42+
- Purpose: `Independent processes that arbitrate failover decisions.`
43+
- Placement: Spread across multiple data centers and Azure regions to `ensure no single site controls majority.`
44+
- Outcome: `Only one broker is promoted to live at a time, preserving consistency.`
45+
3. Azure Container Apps role:
46+
- Execution environment: Runs brokers and voters as `containers without needing to manage VMs or Kubernetes.`
47+
- Resiliency: `Provides zone and region fault tolerance, automatic restarts, and scaling.`
48+
- Networking: `VNET integration and private endpoints secure broker‑to‑broker and voter communication.`
49+
- Operations: Readiness/liveness probes, autoscaling, and revision rollouts align with Artemis HA needs.
50+
51+
> How ACA + Artemis Work Together?
52+
53+
| Layer | What Artemis Provides | What ACA Provides |
54+
|-------|-----------------------|-------------------|
55+
| **Messaging logic** | Brokers handle queues, topics, persistence, clustering | Container runtime for brokers, scaling, probes |
56+
| **HA control** | Quorum voters prevent split‑brain, elect live broker | Geographic distribution, independent failure domains |
57+
| **Durability** | Journals, replication/shared store | Restart/recovery orchestration, resource isolation |
58+
| **Security** | TLS, auth, role‑based access | VNET, private DNS, NSGs, managed identity |
59+
| **Operations** | Failover, fencing, client reconnect | Autoscaling, observability, revision rollouts |
60+
61+
## How Artemis work?
62+
63+
`It’s open source, part of the Apache ActiveMQ project.`
64+
65+
> - **ActiveMQ Artemis is a *message broker server***, a runtime process that applications connect to. `You don’t “embed” it into your code (unless you choose the embedded mode); instead, you run Artemis as a service** (like a database or Kafka), and your application talks to it using APIs or protocols.`
66+
> - Your application code uses a **client library** (for example, JMS in Java, AMQP in many languages, or MQTT for IoT). `In code, you configure a connection** to the broker (hostname, port, protocol).`Then you **send messages** (producer) or **receive messages** (consumer).
67+
68+
Example in Java (simplified): Broker is the server that receives and routes the message `"Order #123"`.
69+
70+
```java
71+
ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://broker-host:61616");
72+
Connection connection = cf.createConnection();
73+
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
74+
Queue queue = session.createQueue("orders");
75+
MessageProducer producer = session.createProducer(queue);
76+
producer.send(session.createTextMessage("Order #123"));
77+
```
78+
79+
- In Artemis HA setups, you have **instances** (brokers).
80+
- One broker is **live** (active, serving clients).
81+
- Another broker is **backup** (standby, waiting).
82+
- If the live broker fails, the backup can become live, but only if **quorum voters** agree.
83+
- This ensures only one broker is live at a time `(avoiding split‑brain).`
84+
85+
> [!NOTE]
86+
> `Split-brain`:
87+
> - In computing, it describes a `situation where two separate data sets are maintained with overlapping scope, leading to inconsistencies due to network partitions or failure conditions.`
88+
> - In distributed systems, it `indicates a scenario where nodes in a cluster lose communication, leading to conflicting data handling and potential data inconsistencies`
89+
90+
91+
92+
<!-- START BADGE -->
93+
<div align="center">
94+
<img src="https://img.shields.io/badge/Total%20views-1532-limegreen" alt="Total views">
95+
<p>Refresh Date: 2025-10-23</p>
96+
</div>
97+
<!-- END BADGE -->

0 commit comments

Comments
 (0)