Skip to main content

Conceptual Introduction

Cerulion uses a topic-based publish/subscribe model for messaging between components. A topic is a named channel (e.g., “temperature”) that acts as a communication pathway. A publisher sends messages to a topic, and a subscriber receives messages from a topic. Messages are transmitted as bytes and automatically deserialized into strongly typed structs. This example runs both a publisher and a subscriber in the same process to demonstrate the full message lifecycle. In real applications, publishers and subscribers typically run in separate processes or on different machines.

Automatic Discovery

Publishers automatically discover remote subscribers and enable network transport on demand. No manual configuration required.

Shared Session Management

All publishers and subscribers share a single Zenoh session and iceoryx2 node, reducing memory footprint and startup time.

Type Safety

Built-in type validation ensures message type consistency across publishers and subscribers for each topic.

Centralized Management

Single manager instance handles all topics, simplifying connection management and reducing resource overhead.
TopicManager is especially useful when you have multiple publishers and subscribers, as it reduces resource overhead and simplifies connection management compared to creating individual sessions for each pub/sub pair.

Key Behaviors and Guarantees

  • Subscriptions remain active as long as their handles are alive - Keep subscriber handles in scope for the lifetime you need the subscription
  • pull never blocks - Always returns immediately with Ok(Some(bytes)), Ok(None), or Err(e)
  • Messages are delivered in send order per topic - Messages sent to the same topic arrive in the order they were sent
  • Local mode is automatically enabled when possible - When publisher and subscriber are in the same process, Cerulion automatically uses high-performance local transport
  • Serialization and deserialization are handled internally - You work with typed structs; the manager handles byte conversion

Next Steps