Branching

Branching

Branching is the routing of messages to one or more other channels. Branching is restricted to channels within the same group.

There are two branch devices:

Branching and routing of messages is also supported within custom code. There are two methods on the BaseDevice class available:

  • ForwardMessageAsync: Used to branch a message to another queue.

  • QueueMessageAsync: Used to send a new message to another queue.

image-20250916-165247.png

Branching is an inherently heavy operation, as it replicates message data within the database (causing amplification). While fully supported, less branching results in a faster system with smaller database sizes.

The underlying branch logic is dependant on the message database type. The logic for Sql Server, for example, is able to minimize write amplification in some cases. The Postgres and Mongo database typically always have a message copy per target queue due to the way the database is designed.