Skip to content

Commit 6dbb2bf

Browse files
authored
Merge pull request #7735 from Particular/routing-slip-review
Review routing slip
2 parents ae80c84 + 95cfa7a commit 6dbb2bf

File tree

1 file changed

+41
-49
lines changed

1 file changed

+41
-49
lines changed

samples/routing-slips/sample.md

Lines changed: 41 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,114 @@
11
---
22
title: Routing Slips
3-
reviewed: 2023-09-15
3+
reviewed: 2025-08-14
44
component: MessageRouting
55
---
66

77
## Introduction
88

9-
Uses the [Routing Slip pattern](https://www.enterpriseintegrationpatterns.com/patterns/messaging/RoutingTable.html) feature of the [MessageRouting](https://github.com/jbogard/NServiceBus.MessageRouting) project.
9+
This sample demonstrates the use of the [Routing Slip pattern](https://www.enterpriseintegrationpatterns.com/patterns/messaging/RoutingTable.html) with the [MessageRouting](https://github.com/jbogard/NServiceBus.MessageRouting) project.
1010

11+
A **routing slip** allows a message to carry a list of destinations it should pass through. Each endpoint processes the message and then forwards it to the next stop on the slip. This enables dynamic workflows without hardcoding routes between endpoints.
1112

12-
## Code walk-through
13+
## Solution Overview
1314

14-
The solution consists of 6 Projects
15+
The solution consists of six projects:
1516

16-
* Messages: The shared message definitions.
17-
* Sender: Initiates the message sends.
18-
* StepA, StepB, StepC: The handling endpoints to to show how the message flows between endpoints.
19-
* ResultHost: The final destination endpoint for messages that logs all the endpoints the message was routed through.
17+
- **Messages** – Shared message definitions.
18+
- **Sender**Initiates the message send and defines the route.
19+
- **StepA, StepB, StepC** – Processing endpoints that demonstrate how a message flows between steps.
20+
- **ResultHost**The final destination that logs all endpoints the message passed through.
2021

22+
## Enabling Routing Slips
2123

22-
### Enabling Routing Slips Feature
23-
24-
All endpoints have routing slips enabled:
24+
All endpoints have the routing slip feature enabled:
2525

2626
snippet: enableRoutingSlips
2727

28+
## Multiple Message Interpretations
2829

29-
## Multiple message interpretations
30+
Each step in the route defines its own interpretation of the message.
3031

31-
Each step in the routing has its own definition of the message. For example StepA considers the message contract to be.
32+
For example, StepA treats the message contract as follows:
3233

3334
snippet: single-message
3435

35-
Both the Sender and the ResultHost have the full message context by referencing the Messages project.
36+
Both the Sender and ResultHost projects use the full message context by referencing the **Messages** project:
3637

3738
snippet: multi-message
3839

39-
On Send all share properties are set.
40+
When sending, all shared properties are set:
4041

4142
snippet: multi-message-send
4243

43-
But in each step project they are only aware of the specific their specific message interpretations:
44+
However, in each step project, handlers only work with their own specific interpretation of the message:
4445

4546
snippet: step-handler
4647

48+
## Message Sending
4749

48-
### Message sending
49-
50-
The Sender project alternates between two send actions:
50+
The **Sender** project alternates between two send actions:
5151

5252
snippet: alternate
5353

54-
55-
#### Route to A, C and ResultHost
54+
### Route to A, C, and ResultHost
5655

5756
snippet: SendAC
5857

59-
60-
#### Route to A, B, C and ResultHost
58+
### Route to A, B, C, and ResultHost
6159

6260
snippet: SendABC
6361

64-
6562
## Runtime Behavior
6663

64+
### When routing to A, C, and ResultHost
6765

68-
### When routing to A, C and ResultHost
69-
70-
1. StepA receives message
71-
1. StepC receives message
72-
1. ResultHost receives message
66+
1. StepA receives the message
67+
2. StepC receives the message
68+
3. ResultHost receives the message
7369

7470
```mermaid
7571
sequenceDiagram
76-
7772
Participant Sender
7873
Participant StepA
7974
Participant StepB
8075
Participant StepC
8176
Participant ResultHost
8277
Sender ->> StepA: Route
83-
Note over StepA: Sets Attachment "Foo = Bar"
84-
StepA->> StepC: Route
85-
Note over StepC: Read Attachment "Foo"
86-
StepC->> ResultHost: Route
78+
Note over StepA: Sets attachment "Foo = Bar"
79+
StepA ->> StepC: Route
80+
Note over StepC: Reads attachment "Foo"
81+
StepC ->> ResultHost: Route
8782
```
8883

84+
### When routing to A, B, C, and ResultHost
8985

90-
### When routing to A, B, C and ResultHost
91-
92-
1. StepA receives message
93-
1. StepB receives message
94-
1. StepC receives message
95-
1. ResultHost receives message
86+
1. StepA receives the message
87+
2. StepB receives the message
88+
3. StepC receives the message
89+
4. ResultHost receives the message
9690

9791
```mermaid
9892
sequenceDiagram
99-
10093
Participant Sender
10194
Participant StepA
10295
Participant StepB
10396
Participant StepC
10497
Participant ResultHost
10598
Sender ->> StepA: Route
106-
Note over StepA: Sets Attachment "Foo = Bar"
107-
StepA->> StepB: Route
108-
StepB->> StepC: Route
109-
Note over StepC: Read Attachment "Foo"
110-
StepC->> ResultHost: Route
99+
Note over StepA: Sets attachment "Foo = Bar"
100+
StepA ->> StepB: Route
101+
StepB ->> StepC: Route
102+
Note over StepC: Reads attachment "Foo"
103+
StepC ->> ResultHost: Route
111104
```
112105

113-
114106
## Attachments
115107

116-
Note that StepA sets a routing slip attachment:
108+
StepA sets a routing slip attachment:
117109

118110
snippet: set-attachments
119111

120-
Which is then retrieved by StepC
112+
StepC then retrieves the attachment:
121113

122114
snippet: read-attachment

0 commit comments

Comments
 (0)