# Real-World Event Sourcing: broadcast\_message usage and explanation

**URL:** <https://forum.devtalk.com/t/real-world-event-sourcing-broadcast-message-usage-and-explanation/211792>\
**Category:** PragProg Customers\
**Tags:** book-real-world-event-sourcing, errata\
**Created:** [22 August 2025 03:34 UTC](https://forum.devtalk.com/t/real-world-event-sourcing-broadcast-message-usage-and-explanation/211792 "2025-08-22T03:34:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![victorhazbun](https://forum.devtalk.com/user_avatar/forum.devtalk.com/victorhazbun/32/7607_2.png) [@victorhazbun](https://forum.devtalk.com/u/victorhazbun)\
**Post date:** [22 August 2025 03:34 UTC](https://forum.devtalk.com/t/real-world-event-sourcing-broadcast-message-usage-and-explanation/211792/1 "2025-08-22T03:34:16Z")

</div>

## Real-World Event Sourcing: `broadcast_message` usage and explanation

- **Page:** 61
- **Version:** B2.0
- **Book type:** EPUB

The function `broadcast_message/1` is defined but never actually invoked in the examples, and its explanation is too brief.

> _The broadcast\_message function is to be called by whatever component wishes to perform an injection. The message (if necessary) is converted into a cloud event and then passed down to any interested stage consumers._

Function definition:

```elixir
  @doc """
  Injects a raw message that is not in cloud event format
  """
  def broadcast_message(message) do
    GenStage.call( __MODULE__ , {:notify, message})
  end

```

However, the current text does not show **who** should call it, nor does it provide an example of usage in the context of the pipeline. This leaves readers uncertain about when and how to use it.

**Suggested improvement:**

- Clarify in the text which components are expected to call `broadcast_message/1`.
- Provide a small code snippet showing a realistic call (e.g., from an external producer or test) so that readers can see the injection mechanism in action.
