Messaging Model
FlowMQ's core messaging model is protocol-independent.
Producers publish messages with topics. A topic is the logical address of a message, and FlowMQ routes the message by matching the topic against destination filters. Consumers receive messages from these destinations, which can be streams, queues, or subscriptions.
The Basic Flow
- A producer publishes a message with a topic.
- FlowMQ uses the topic as the message's routing address.
- FlowMQ matches the topic against filters configured on streams, queues, and subscriptions.
- Each matching destination receives a copy of the message.
- Consumers read messages from those destinations.
Producers and consumers are decoupled from each other. A producer does not need to know which consumers exist. A consumer does not need to know which producer sent the message.
Messages
A message contains the application payload and optional headers. When a producer publishes the message, it is associated with a topic that FlowMQ uses as the routing address.
See Messages for more detail.
Topics
A topic is a logical address used for message routing.
Topics are hierarchical strings separated by /:
sensors/factory-1/temperature
orders/us/created
devices/vehicle-42/statusSee Topics for more detail.
Topic Filters
A topic filter selects a set of topics.
Topic filters support wildcards:
| Wildcard | Meaning | Example |
|---|---|---|
+ | Matches one topic level | sensors/+/temperature |
# | Matches zero or more levels at the end | sensors/# |
See Topics for more detail.
Destinations
Topics are routing addresses, not destinations. A destination is where matching messages are stored or delivered for consumers.
Destinations select messages by binding to topic filters. When a message topic matches a destination's filter, FlowMQ delivers a copy of the message to that destination.
Consumers receive messages from destinations. The destination type determines the consumption model:
| Destination | Purpose | Consumption model |
|---|---|---|
| Stream | Durable event history | Consumers read by offset and can replay messages |
| Queue | Message queue | Messages can accumulate in the queue until consumed; each message is delivered to one consumer |
| Subscription | Real-time fan-out | Each matching message is pushed to all active consumers |
Bindings
A binding connects a destination to one or more topic filters.
Streams, queues, and subscriptions receive messages through bindings. When a message topic matches any filter in a binding, FlowMQ delivers a copy of the message to that destination.
If a message matches bindings on multiple destinations, FlowMQ delivers a copy to each matching destination.
What This Model Enables
- Producers and consumers are decoupled.
- One message can feed multiple downstream destinations, and consumers can receive messages from the destinations they need without affecting each other.
- Real-time delivery and durable storage can be configured independently.
- Destination types can be extended over time as new delivery or storage models are needed.
- Routing rules can change without changing producers.