Skip to content

Commit bc3332e

Browse files
authored
Change to hostid hash generation docs (#8364)
1 parent ba4d9ca commit bc3332e

3 files changed

Lines changed: 41 additions & 43 deletions

File tree

nservicebus/compliance/fips_host-id-generation_core_[10,).partial.md

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## NServiceBus
2+
3+
Starting in version 10.2, NServiceBus can use a non-cryptographic hash algorithm (XxHash128) to generate deterministic unique identifiers for endpoints, also known as host identifiers (HostIds). Because XxHash128 is not a cryptographic algorithm, FIPS policy enforcement does not block host identifier generation; the host ID workaround described below is no longer needed.
4+
5+
To ensure the non-cryptographic hash is used in NServiceBus 10, set the following AppContext switch before endpoint startup:
6+
7+
```csharp
8+
AppContext.SetSwitch("NServiceBus.Core.Hosting.UseV2DeterministicGuid", true);
9+
```
10+
11+
Or via environment variable:
12+
13+
```text
14+
DOTNET_NServiceBus_Core_Hosting_UseV2DeterministicGuid=true
15+
```
16+
17+
Or via MSBuild in a project file:
18+
19+
```xml
20+
<ItemGroup>
21+
<RuntimeHostConfigurationOption Include="NServiceBus.Core.Hosting.UseV2DeterministicGuid" Value="true" />
22+
</ItemGroup>
23+
```
24+
25+
> [!WARNING]
26+
> Changing the host identifier algorithm changes the host ID that identifies an endpoint in ServicePulse and ServiceControl. Changes to the algorithm will cause existing known endpoints to appear inactive in the ServicePulse [heartbeats](/monitoring/heartbeats/in-servicepulse.md) and [monitoring](/monitoring/metrics/in-servicepulse.md) views while new instances (with the changed host identifiers) appear in their place. Stale instances should be [removed from the monitoring view](/monitoring/metrics/in-servicepulse.md#disconnected-endpoints-removing-disconnected-endpoints).
27+
>
28+
> See the [NServiceBus version 10 to 11 upgrade guide](/nservicebus/upgrades/10to11/#host-identifier-algorithm-change) for more information on migrating from MD5 to the XxHash128 hash algorithm.

nservicebus/upgrades/10to11/index.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,23 @@ The following APIs are deprecated:
196196

197197
## Host identifier algorithm change
198198

199-
In version 11, the default algorithm for generating deterministic host identifiers changes from MD5 to XxHash128 (RFC 9562 version 8 GUIDs). This produces different host identifiers, which affects how endpoints are identified in [ServicePulse](/servicepulse/) and [ServiceControl](/servicecontrol/).
199+
In version 11, the default algorithm for generating deterministic host identifiers changes from MD5 to XxHash128 (RFC 9562 version 8 GUIDs). This produces different host identifiers, which affects how endpoints are identified in [ServicePulse](/servicepulse/) and [ServiceControl](/servicecontrol/). Changing the algorithm will cause existing known endpoints to appear inactive in the ServicePulse [heartbeats](/monitoring/heartbeats/in-servicepulse.md) and [monitoring](/monitoring/metrics/in-servicepulse.md) views, while new instances (with the changed host identifiers) appear in their place.
200200

201201
### Rationale
202202

203203
This change provides a path for customers who require **FIPS-compliant** host identifiers (see [FIPS compliance](/nservicebus/compliance/fips.md)). The legacy MD5-based algorithm is not FIPS-compliant; by moving to the new `XxHash128` algorithm, the framework uses a compliant standard by default.
204204

205-
To ensure a predictable transition, this is designed as a multi-phase migration. In version 11, the new algorithm becomes the default. By making this an explicit switch rather than an automatic change, there is a clear "escape hatch" to preserve legacy host IDs if correlation with older monitoring data (such as ServicePulse) must be maintained during the transition.
205+
To ensure a predictable transition, this is designed as a multi-phase migration:
206+
207+
| NServiceBus Versions | Hashes Available | Default Hash | App Switch |
208+
|:-:|:-:|:-:|:-:|
209+
| <= 10.2 | MD5 Only | MD5 | - |
210+
| >= 10.2 && < 11.0 | MD5 + XxHash128 | MD5 | Can opt in |
211+
| >= 11.0 && < 12.0 | MD5 + XxHash128 | XxHash128 | Can opt out |
212+
| >= 12.0 | XxHash128 Only | XxHash128 | - |
213+
214+
215+
In version 11, XxHash128 becomes the default. By making this an explicit switch rather than an automatic change, there is a clear "escape hatch" to preserve legacy host IDs if correlation with older monitoring data (such as ServicePulse) must be maintained during the transition.
206216

207217
This approach allows the framework to move toward a compliant default while providing the necessary flexibility to manage existing integrations before the legacy algorithm is removed in version 12.
208218

@@ -218,7 +228,7 @@ To preserve the existing MD5-based host identifier after upgrading, set the foll
218228
AppContext.SetSwitch("NServiceBus.Core.Hosting.UseV2DeterministicGuid", false);
219229
```
220230

221-
Or via environment variable (.NET 9+):
231+
Or via environment variable:
222232

223233
```text
224234
DOTNET_NServiceBus_Core_Hosting_UseV2DeterministicGuid=false

0 commit comments

Comments
 (0)