Skip to content

Producers

A Producer (also known as a Publisher) is any client application that writes messages to FlowMQ. Its sole responsibility is to create messages and send them to a specific Topic. The producer is the entry point for all data into the system.

In FlowMQ, producers are fully decoupled from consumers. A producer has no knowledge of which queues, streams, or subscriptions will receive its messages, or how many of them there are. This fundamental design principle makes the entire system highly flexible and scalable.


Core Responsibilities

The role of a producer is simple and focused:

  1. Construct a Message: The producer assembles the message, which consists of a topic, an optional set of headers, and a payload.
  2. Publish to a Topic: The producer sends the message to the FlowMQ broker, targeting a specific, non-wildcard topic name (e.g., orders/us/new). It does not specify a queue or a stream.

The Decoupling Principle in Action

By publishing only to a topic, the producer's logic remains simple, even in a complex system. The FlowMQ broker takes on the responsibility of routing the message to all interested consumers based on their bindings.

In this diagram, the producer sends a single message. The broker then delivers a copy to a queue for reliable processing, to a stream for historical analysis, and to a subscription for live updates. If a new service needs these order events, you simply add a new queue or stream with the correct topic binding—no changes are required to the producer.


Publishing Guarantees

FlowMQ is designed for reliability. When a producer publishes a message, it typically waits for an acknowledgment from the broker. This acknowledgment confirms that the broker has received the message and durably persisted it to disk.

This ensures at-least-once delivery from the producer to the broker. Even if the producer crashes immediately after sending, once the acknowledgment is received, the message is safely stored in FlowMQ and will be routed to its destinations.