Skip to content

Commit 8d2865b

Browse files
Use the name "dispatch message" rather than control message for clarity (#7232)
1 parent 3d06f69 commit 8d2865b

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

nservicebus/transactional-session/index.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ The transactional session feature requires a supported persistence package to st
7777

7878
## Design considerations
7979

80-
It's recommended to not mix the processing of control messages with business messages in order to get:
80+
It's recommended to not mix the processing of dispatch messages with business messages in order to get:
8181

82-
- Predictable control message dispatch: Processing of control messages will be more reliable since there is no risk of getting delayed behind slow business messages
83-
- More accurate metrics: Metrics like critical time and queue length will accurately represent the performance of the control message processing and not be skewed by business messages
84-
- Simplified management: Knowing that the endpoint only processes control messages makes it possible to always retry all failed messages related to the endpoint via tools like ServicePulse
82+
- Predictable dispatch message dispatch: Processing of dispatch messages will be more reliable since there is no risk of getting delayed behind slow business messages
83+
- More accurate metrics: Metrics like critical time and queue length will accurately represent the performance of the dispatch message processing and not be skewed by business messages
84+
- Simplified management: Knowing that the endpoint only processes dispatch messages makes it possible to always retry all failed messages related to the endpoint via tools like ServicePulse
8585

8686
When configuring endpoints for usage measurement in ServicePulse, mark dedicated transactional session processor endpoints with the appropriate [endpoint type indicator](/servicepulse/usage.md#setting-an-endpoint-type-endpoint-type-indicators).
8787

@@ -162,7 +162,7 @@ Internally, the transactional session doesn't use a single transaction that span
162162
6. Transport operations are captured by the `PendingTransportOperations`
163163
7. The user can store any data using the persistence-specific session, which is accessible through the transactional session.
164164
8. When all operations are registered, the user calls `Commit` on the transactional session.
165-
9. A control message to complete the transaction is dispatched. The control message is independent of the message operations and is not stored in the outbox record.
165+
9. A dispatch message to complete the transaction is sent. The dispatch message is independent of the message operations and is not stored in the outbox record.
166166
10. The message operations are converted into an outbox record.
167167
11. The outbox record is returned to the transactional session
168168
12. The outbox record is saved to the storage seam.
@@ -173,39 +173,39 @@ Internally, the transactional session doesn't use a single transaction that span
173173
174174
### Phase 2
175175

176-
The control message is processed as follows:
176+
The dispatch message is processed as follows:
177177

178178
* Find the outbox record.
179179
* If it exists, and it hasn't been marked as dispatched, and there are pending operations:
180180
* Dispatched the messages, and the outbox record is set as dispatched.
181-
* If it doesn't exist yet, delay the processing of the control message.
181+
* If it doesn't exist yet, delay the processing of the dispatch message.
182182

183183
## Failure scenarios
184184

185-
The transactional session provides atomic store-and-send guarantees, similar to the outbox feature (except for incoming message de-duplication). The control message is used to ensure that **exactly one** of the following outcomes occurs:
185+
The transactional session provides atomic store-and-send guarantees, similar to the outbox feature (except for incoming message de-duplication). The dispatch message is used to ensure that **exactly one** of the following outcomes occurs:
186186

187187
* Transaction finishes with data being stored, and outgoing messages eventually sent - when the `Commit` path successfully stores the `OutboxRecord`
188-
* Transaction finishes with no visible side effects - when the control message stores the `OutboxRecord`
188+
* Transaction finishes with no visible side effects - when the dispatch message stores the `OutboxRecord`
189189

190-
Sending the control message first ensures that, eventually, the transaction will have an atomic outcome. If the `Commit` of the `OutboxRecord` succeeds, the control message will ensure the outgoing operations are sent.
190+
Sending the dispatch message first ensures that, eventually, the transaction will have an atomic outcome. If the `Commit` of the `OutboxRecord` succeeds, the dispatch message will ensure the outgoing operations are sent.
191191

192-
### Failure to dispatch the control message
192+
### Failure to send the dispatch message
193193

194-
If dispatching the control message fails, the transactional session changes will roll back, and an error will be raised to the user committing the session.
194+
If sending the dispatch message fails, the transactional session changes will roll back, and an error will be raised to the user committing the session.
195195

196-
If the transaction completes and the control message fails to process through all the retry attempts, the control message will be moved to the error queue and the outgoing messages will not be dispatched. Once the error is resolved, the control message must be manually retried in ServicePulse to ensure the outgoing messages are dispatched. If the messages are not manually retried, the stored outgoing messages will never be delivered. If that's undesirable, the system must be returned to a consistent state via other means.
196+
If the transaction completes and the dispatch message fails to process through all the retry attempts, the dispatch message will be moved to the error queue and the outgoing messages will not be dispatched. Once the error is resolved, the dispatch message must be manually retried in ServicePulse to ensure the outgoing messages are dispatched. If the messages are not manually retried, the stored outgoing messages will never be delivered. If that's undesirable, the system must be returned to a consistent state via other means.
197197

198198
### Failure to commit the outbox record
199199

200-
If the `Commit` fails, the control message will (after the [maximum commit duration](#advanced-configuration-maximum-commit-duration) elapses) eventually be consumed, leaving no side effects.
200+
If the `Commit` fails, the dispatch message will (after the [maximum commit duration](#advanced-configuration-maximum-commit-duration) elapses) eventually be consumed, leaving no side effects.
201201

202202
### Commit takes too long
203203

204-
When the commit takes longer than the [maximum commit duration](#advanced-configuration-maximum-commit-duration), the control message will result in a tombstone record in the outbox preventing the commit from succeeding. The following exception is thrown:
204+
When the commit takes longer than the [maximum commit duration](#advanced-configuration-maximum-commit-duration), the dispatch message will result in a tombstone record in the outbox preventing the commit from succeeding. The following exception is thrown:
205205

206206
`Failed to commit the transactional session. This might happen if the maximum commit duration is exceeded`
207207

208-
A variation of this is when using a remote processing endpoint that does not have the transactional session enabled. In this scenario, the tombstone record will be created immediately when the control message is processed, forcing a rollback of the commit. When this happens, the following exception is thrown:
208+
A variation of this is when using a remote processing endpoint that does not have the transactional session enabled. In this scenario, the tombstone record will be created immediately when the dispatch message is processed, forcing a rollback of the commit. When this happens, the following exception is thrown:
209209

210210
`Failed to commit the transactional session. This might happen if the maximum commit duration is exceeded or if the transactional session has not been enabled on the configured processor endpoint - MyProcessorEndpoint`
211211

@@ -223,9 +223,9 @@ The default value for the maximum commit duration is `TimeSpan.FromSeconds(15)`.
223223

224224
snippet: configuring-timeout-transactional-session
225225

226-
The maximum commit duration does not represent the total transaction time, but rather the time it takes to complete the commit operation (as observed from the perspective of the control message). In practice, the observed total commit time might be longer due to delays in the transport caused by latency, delayed delivery, load on the input queue, endpoint concurrency limits, and more.
226+
The maximum commit duration does not represent the total transaction time, but rather the time it takes to complete the commit operation (as observed from the perspective of the dispatch message). In practice, the observed total commit time might be longer due to delays in the transport caused by latency, delayed delivery, load on the input queue, endpoint concurrency limits, and more.
227227

228-
When the control message is consumed, but the outbox record is not yet available in storage, the following formula is applied to delay the message (see [Phase 2](#how-it-works-phase-2)):
228+
When the dispatch message is consumed, but the outbox record is not yet available in storage, the following formula is applied to delay the message (see [Phase 2](#how-it-works-phase-2)):
229229

230230
```csharp
231231
CommitDelayIncrement = 2 * CommitDelayIncrement;
@@ -239,6 +239,6 @@ partial: config
239239

240240
### Metadata
241241

242-
It is possible to add metadata (e.g. tenant information) transactional session control message via custom headers. These headers can be accessed by a [custom behavior](/nservicebus/pipeline/manipulate-with-behaviors.md#add-a-new-step) when the control message is received in the `TransportReceive` part of the pipeline.
242+
It is possible to add metadata (e.g. tenant information) transactional session dispatch message via custom headers. These headers can be accessed by a [custom behavior](/nservicebus/pipeline/manipulate-with-behaviors.md#add-a-new-step) when the dispatch message is received in the `TransportReceive` part of the pipeline.
243243

244244
snippet: configuring-metadata-transactional-session

nservicebus/transactional-session/index_remote-processor_transactionalsession_[3.3,).partial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The processor endpoint [must have both the outbox and the transactional session
1717

1818
Using the transactional session in send-only endpoints has the following benefits:
1919

20-
- Simplified management: For short-lived endpoints, there is no longer a need to make sure that all control messages have been processed before decommissioning them
21-
- Targeted scaling: Scaling can be tailored with only the load of control messages in mind since the incoming load to store the records are handled by the endpoint using the processor.
20+
- Simplified management: For short-lived endpoints, there is no longer a need to make sure that all dispatch messages have been processed before decommissioning them
21+
- Targeted scaling: Scaling can be tailored with only the load of dispatch messages in mind since the incoming load to store the records are handled by the endpoint using the processor.
2222

2323
### Outbox cleanup
2424

0 commit comments

Comments
 (0)