Skip to content

Commit 7e55bc8

Browse files
WilliamBZAkentdr
authored andcommitted
Fix links
1 parent 6b50cd8 commit 7e55bc8

File tree

20 files changed

+130
-21
lines changed

20 files changed

+130
-21
lines changed

Diff for: Snippets/DataBus/DataBus_1/CustomDataBus.cs

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
namespace CustomDataBus
2+
{
3+
using NServiceBus.ClaimCheck.DataBus;
4+
using NServiceBus.Features;
5+
using Microsoft.Extensions.DependencyInjection;
6+
using System.IO;
7+
using System.Threading.Tasks;
8+
using System.Threading;
9+
using System;
10+
11+
#region CustomDataBusFeature
12+
class CustomDatabusFeature : Feature
13+
{
14+
public CustomDatabusFeature()
15+
=> DependsOn<DataBus>();
16+
17+
protected override void Setup(FeatureConfigurationContext context)
18+
=> context.Services.AddSingleton<IDataBus, CustomDataBus>();
19+
}
20+
#endregion
21+
22+
#region CustomDataBus
23+
24+
class CustomDataBus :
25+
IDataBus
26+
{
27+
public Task<Stream> Get(string key, CancellationToken cancellationToken)
28+
{
29+
Stream stream = File.OpenRead("blob.dat");
30+
return Task.FromResult(stream);
31+
}
32+
33+
public async Task<string> Put(Stream stream, TimeSpan timeToBeReceived, CancellationToken cancellationToken)
34+
{
35+
using (var destination = File.OpenWrite("blob.dat"))
36+
{
37+
await stream.CopyToAsync(destination, 81920, cancellationToken);
38+
}
39+
return "the-key-of-the-stored-file-such-as-the-full-path";
40+
}
41+
42+
public Task Start(CancellationToken cancellationToken)
43+
{
44+
return Task.CompletedTask;
45+
}
46+
}
47+
48+
#endregion
49+
50+
#region CustomDataBusDefinition
51+
class CustomDatabusDefinition : DataBusDefinition
52+
{
53+
protected override Type ProvidedByFeature()
54+
=> typeof(CustomDatabusFeature);
55+
}
56+
#endregion
57+
58+
class Usage
59+
{
60+
Usage(NServiceBus.EndpointConfiguration endpointConfiguration)
61+
{
62+
#region PluginCustomDataBus
63+
endpointConfiguration.UseDataBus(svc => new CustomDataBus(), new SystemJsonDataBusSerializer());
64+
#endregion
65+
66+
#region SpecifyingSerializer
67+
endpointConfiguration.UseDataBus<FileShareDataBus, SystemJsonDataBusSerializer>();
68+
#endregion
69+
70+
#region SpecifyingDeserializer
71+
endpointConfiguration.UseDataBus<FileShareDataBus, SystemJsonDataBusSerializer>()
72+
.AddDeserializer<BsonDataBusSerializer>();
73+
#endregion
74+
}
75+
76+
class BsonDataBusSerializer : IDataBusSerializer
77+
{
78+
public void Serialize(object databusProperty, Stream stream)
79+
{
80+
}
81+
82+
public object Deserialize(Type propertyType, Stream stream)
83+
{
84+
return default;
85+
}
86+
87+
public string ContentType { get; }
88+
}
89+
}
90+
}

Diff for: architecture/azure/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The Particular Service Platform makes systems follow the [ten design principles
6060

6161
### Design patterns
6262

63-
[Azure Cloud Design Patterns](https://learn.microsoft.com/en-us/azure/architecture/patterns/) lists many proven patterns for addressing specific challenges. The Particular Service Platform implements many of these such as [Asynchronous Request-Reply](/nservicebus/messaging/reply-to-a-message.md), [Circuit Breaker](/nservicebus/recoverability/#automatic-rate-limiting), [Claim Check](/nservicebus/messaging/databus/), [Competing Consumers](/nservicebus/scaling.md#scaling-out-to-multiple-nodes-competing-consumers), and more.
63+
[Azure Cloud Design Patterns](https://learn.microsoft.com/en-us/azure/architecture/patterns/) lists many proven patterns for addressing specific challenges. The Particular Service Platform implements many of these such as [Asynchronous Request-Reply](/nservicebus/messaging/reply-to-a-message.md), [Circuit Breaker](/nservicebus/recoverability/#automatic-rate-limiting), [Claim Check](/nservicebus/messaging/claimcheck/), [Competing Consumers](/nservicebus/scaling.md#scaling-out-to-multiple-nodes-competing-consumers), and more.
6464

6565
[**Talk to a solution architect to help identify suitable design patterns →**](https://particular.net/solution-architect?message=I%27d%20like%20to%20talk%20to%20a%20solution%20architect%20to%20help%20identify%20suitable%20design%20patterns%20for%20my%20system.)
6666

Diff for: nservicebus/hosting/service-fabric-hosting/hosting-gateway.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ reviewed: 2024-02-09
88
---
99

1010
> [!WARNING]
11-
> [Gateway](/nservicebus/gateway) hosted in Service Fabric does not support forwarding messages containing [Databus](/nservicebus/messaging/databus/) properties.
11+
> [Gateway](/nservicebus/gateway) hosted in Service Fabric does not support forwarding messages containing [Databus](/nservicebus/messaging/claimcheck/) properties.
1212
1313
When adopting Service Fabric, it's not uncommon that the Service Fabric hosted endpoints need to interact with endpoints outside of the cluster. This can get tricky especially when the endpoints inside Service Fabric are stateful. When integrating using sender side distribution, or when using the Service Fabric built-in [reverse proxy](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reverseproxy) to expose the endpoints as web services, the partition information needs to be provided by the consumer.
1414

Diff for: nservicebus/messaging/claimcheck/binary/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ This DataBus serializer uses the `BinaryFormatter` to serialize and deserialize
1515
snippet: BinaryDataBusUsage
1616

1717
> [!WARNING]
18-
> `BinaryFormatter` [is dangerous and is not recommended for data processing](https://aka.ms/binaryformatter). Applications should stop using BinaryFormatter as soon as possible, even if they believe the data they're processing to be trustworthy. BinaryFormatter is insecure and can't be made secure. Switch to a [safer serializer](/nservicebus/messaging/databus/#serialization). Refer to the [Migration from BinaryFormatter](/nservicebus/upgrades/7to8/databus.md#migration-from-binaryformatter) for details.
18+
> `BinaryFormatter` [is dangerous and is not recommended for data processing](https://aka.ms/binaryformatter). Applications should stop using BinaryFormatter as soon as possible, even if they believe the data they're processing to be trustworthy. BinaryFormatter is insecure and can't be made secure. Switch to a [safer serializer](/nservicebus/messaging/claimcheck/#serialization). Refer to the [Migration from BinaryFormatter](/nservicebus/upgrades/7to8/databus.md#migration-from-binaryformatter) for details.

Diff for: nservicebus/messaging/claimcheck/index.md

+22
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,28 @@ snippet: MessageWithLargePayloadUsingConvention
8383

8484
partial: serialization
8585

86+
## Serialization
87+
88+
To configure the data bus, a serializer must be chosen. The recommended serializer is `SystemJsonDataBusSerializer` which is built into `NServiceBus` and uses the System.Text.Json serializer.
89+
90+
snippet: SpecifyingSerializer
91+
92+
### Additional deserializers
93+
94+
Additional deserializers can be added when configuring the data bus. They are picked up based on the data bus content-type header of the message, and also when the main serializer fails to deserialize a message.
95+
96+
snippet: SpecifyingDeserializer
97+
98+
### Implementing custom serializers
99+
100+
To override the data bus property serializer, create a class that implements `IDataBusSerializer` and add it to the dependency injection container when configuring the data bus. The custom serializer must be available to both the sending and the receiving endpoints.
101+
102+
> [!NOTE]
103+
> Implementations of `IDataBusSerializer` should not close `Stream` instances that NServiceBus provides. NServiceBus manages the lifecycle of these `Stream` instances and may attempt to manipulate them after the custom serializer has been called.
104+
105+
> [!WARNING]
106+
> For security purposes, the type information loaded from the payload should not be used. Instead, use the `Type` property provided to the `Deserialize` method.
107+
86108
## `DataBus` attachments cleanup
87109

88110
The `DataBus` implementations each behave differently when cleaning up the physical attachments used to transfer the data properties.

Diff for: nservicebus/messaging/conventions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Currently *conventions* exist to identify:
1616
* [Events](/nservicebus/messaging/messages-events-commands.md)
1717
* [Messages](/nservicebus/messaging/messages-events-commands.md)
1818
* [Message Property Encryption](/nservicebus/security/property-encryption.md)
19-
* [Data Bus](/nservicebus/messaging/databus/)
19+
* [Data Bus](/nservicebus/messaging/claimcheck/)
2020
* [TimeToBeReceived](/nservicebus/messaging/discard-old-messages.md)
2121

2222
Message types can be defined in a *Portable Class Library* (PCL) and shared across multiple platforms, even if the platform does not use NServiceBus for message processing.

Diff for: nservicebus/messaging/databus/index.md

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ title: NServiceBus DataBus feature
33
summary: How to handle messages that are too large to be sent by a transport natively by using NServiceBus DataBus
44
component: Core
55
reviewed: 2024-08-01
6-
redirects:
7-
- nservicebus/databus
8-
- samples/pipeline/stream-properties
96
related:
107
- samples/databus/file-share-databus
118
- samples/databus/custom-serializer
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
> [!WARNING]
2-
> The `DataBus` feature is available as a [dedicated NuGet package](/nservicebus/messaging/databus/). The API documented on this page will continue to work for NServiceBus Version 9 but it will hint about its upcoming obsoletion with the following warning: *The DataBus feature is released as a dedicated 'NServiceBus.ClaimCheck.DataBus' package.*.
2+
> The `DataBus` feature is available as a [dedicated NuGet package](https://www.nuget.org/packages/NServiceBus.ClaimCheck.DataBus/). The API documented on this page will continue to work for NServiceBus Version 9 but it will hint about its upcoming obsoletion with the following warning: *The DataBus feature is released as a dedicated 'NServiceBus.ClaimCheck.DataBus' package.*.
33
> The new documentation is [here](/nservicebus/messaging/claimcheck/).

Diff for: nservicebus/messaging/headers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ snippet: HeaderWriterEncryptionBody
454454

455455
## File share data bus headers
456456

457-
When using the [file share data bus](/nservicebus/messaging/databus/file-share.md), extra headers and serialized message information are necessary to correlate between the information on the queue and the data on the file system.
457+
When using the [file share data bus](/nservicebus/messaging/claimcheck/file-share.md), extra headers and serialized message information are necessary to correlate between the information on the queue and the data on the file system.
458458

459459

460460
### Using DataBusProperty

Diff for: nservicebus/messaging/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ The approaches to messaging in NServiceBus can be categorized into the following
2323
* [Message routing](/nservicebus/messaging/routing.md)
2424
* [Scheduling](/nservicebus/scheduling/)
2525
* [Outbox](/nservicebus/outbox/)
26-
* [Databus](/nservicebus/messaging/databus/)
26+
* [Databus](/nservicebus/messaging/claimcheck/)

Diff for: nservicebus/operations/auditing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ When auditing is enabled, all messages are audited by default. To control which
101101
102102
Auditing works by sending an exact copy of the received message to the audit queue, so filtering out individual properties is not supported.
103103
104-
For sensitive properties, e.g., credit card numbers or passwords, use [message property encryption](/nservicebus/security/property-encryption.md). For large properties, consider the [data bus feature](/nservicebus/messaging/databus/) to avoid including the actual payload in the audited message.
104+
For sensitive properties, e.g. credit card numbers or passwords, use [message property encryption](/nservicebus/security/property-encryption.md). For large properties, consider the [data bus feature](/nservicebus/messaging/claimcheck/) to avoid including the actual payload in the audited message.
105105
106106
## Additional audit information
107107

Diff for: nservicebus/upgrades/absdatabus-2to3.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ isUpgradeGuide: true
99
### Cleanup
1010

1111
The default cleanup method is disabled by default.
12-
Refer to the [documentation](/nservicebus/messaging/databus/azure-blob-storage.md) to choose one of available cleanup strategies.
12+
Refer to the [documentation](/nservicebus/messaging/claimcheck/azure-blob-storage.md) to choose one of available cleanup strategies.

Diff for: nservicebus/upgrades/absdatabus-3to4.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ For scenario's in which advanced authentication modes are desirable, a preconfig
3131

3232
## Expired blob cleanup
3333

34-
The built-in cleanup mechanism has been deprecated. See available [clean-up options](/nservicebus/messaging/databus/azure-blob-storage.md?version=absdatabus_4#cleanup-strategies).
34+
The built-in cleanup mechanism has been deprecated. See available [clean-up options](/nservicebus/messaging/claimcheck/azure-blob-storage.md?version=absdatabus_4#cleanup-strategies).

Diff for: nservicebus/upgrades/absdatabus-6to1.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Instead of `.EnableFeature<AzureDataBusPersistence>()` use `.UseDataBus<AzureDat
2121

2222
### Custom configuration section no longer provided
2323

24-
Configuration options are now available only via the code API. See [Azure Blob Storage Data Bus](/nservicebus/messaging/databus/azure-blob-storage.md) and the [Azure Data Bus sample](/samples/databus/blob-storage-databus) for more details.
24+
Configuration options are now available only via the code API. See [Azure Blob Storage Data Bus](/nservicebus/messaging/claimcheck/azure-blob-storage.md) and the [Azure Data Bus sample](/samples/databus/blob-storage-databus) for more details.
2525

2626

2727
### AzureDataBusDefaults no longer provided
2828

29-
Refer to the [Azure Blob Storage Data Bus](/nservicebus/messaging/databus/azure-blob-storage.md) for details on defaults used.
29+
Refer to the [Azure Blob Storage Data Bus](/nservicebus/messaging/claimcheck/azure-blob-storage.md) for details on defaults used.

Diff for: samples/databus/custom-serializer/sample.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ related:
1212
3. The sample uses the `FileShareDataBus`. Open the solution folder in Windows Explorer and navigate to the `\storage\` sub-folder. Each sub-folder within the `\storage` folder contains serialized data bus properties.
1313

1414
> [!WARNING]
15-
> The FileShareDataBus **does not** remove physical attachments once the message has been processed. Apply a custom [cleanup-strategy](/nservicebus/messaging/databus/file-share.md#cleanup-strategy).
15+
> The FileShareDataBus **does not** remove physical attachments once the message has been processed. Apply a custom [cleanup-strategy](/nservicebus/messaging/claimcheck/file-share.md#cleanup-strategy).
1616
1717
## Code walk-through
1818

Diff for: samples/databus/databus-custom-serializer-converter/sample.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This sample shows how to send large attachments with NServiceBus via Windows fil
2020
1. Press <kbd>D</kbd> in the window to send a large message. A message has just been sent that is larger than the limit allowed by the learning transport. NServiceBus sends it as an attachment, allowing it to reach the Receiver application.
2121

2222
> [!WARNING]
23-
> The FileShareDataBus **does not** remove physical attachments once the message has been processed. Apply a custom [cleanup-strategy](/nservicebus/messaging/databus/file-share.md#cleanup-strategy).
23+
> The FileShareDataBus **does not** remove physical attachments once the message has been processed. Apply a custom [cleanup-strategy](/nservicebus/messaging/claimcheck/file-share.md#cleanup-strategy).
2424
2525
## Code walk-through
2626

Diff for: samples/databus/file-share-databus/sample.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ related:
1515
1. Click <kbd>N</kbd> in the Sender window. A message larger than the allowed limit is sent, but this time without utilizing the NServiceBus attachments mechanism. An exception is thrown in the "Sender" application.
1616

1717
> [!WARNING]
18-
> The FileShareDataBus **does not** remove physical attachments once the message has been processed. Apply a custom [cleanup-strategy](/nservicebus/messaging/databus/file-share.md#cleanup-strategy).
18+
> The FileShareDataBus **does not** remove physical attachments once the message has been processed. Apply a custom [cleanup-strategy](/nservicebus/messaging/claimcheck/file-share.md#cleanup-strategy).
1919
2020
## Code walk-through
2121

Diff for: samples/unobtrusive/sample.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ The `ConventionExtensions` class tells NServiceBus how to determine which types
2323

2424
snippet: CustomConvention
2525

26-
It also demonstrates how to configure conventions for the [data bus](/nservicebus/messaging/databus/) and [time-to-be-received](/nservicebus/messaging/discard-old-messages.md) features.
26+
It also demonstrates how to configure conventions for the [data bus](/nservicebus/messaging/claimcheck/) and [time-to-be-received](/nservicebus/messaging/discard-old-messages.md) features.

Diff for: servicecontrol/servicecontrol-instances/hardware.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The embedded RavenDB will use additional RAM to improve indexing performance. Du
4949

5050
### Message size / MaxBodySizeToStore
5151

52-
In general, [the smaller the messages](https://particular.net/blog/putting-your-events-on-a-diet), the faster ServiceControl will process audit records. For larger message payloads, consider using the [data bus feature](/nservicebus/messaging/databus/).
52+
In general, [the smaller the messages](https://particular.net/blog/putting-your-events-on-a-diet), the faster ServiceControl will process audit records. For larger message payloads, consider using the [data bus feature](/nservicebus/messaging/claimcheck/).
5353

5454
For audit messages, lower the [`ServiceControl.Audit/MaxBodySizeToStore`](/servicecontrol/audit-instances/configuration.md#performance-tuning-servicecontrol-auditmaxbodysizetostore) setting to skip storage of larger audit messages. This setting will only reduce load if non-binary [serialization](/nservicebus/serialization/) is used.
5555

Diff for: transports/azure-storage-queues/troubleshooting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Microsoft.WindowsAzure.Storage.StorageException: Element 0 in the batch returned
1515

1616
Reduce the message body with one or more of the following techniques:
1717

18-
- use the [`DataBus` feature](/nservicebus/messaging/databus/)
18+
- use the [`DataBus` feature](/nservicebus/messaging/claimcheck/)
1919
- apply [message compression](https://www.nuget.org/packages/NServiceBus.Compression/)
2020
- use a [compact binary serializer](/nservicebus/community/#serializers)
2121
- include less data in the message.

0 commit comments

Comments
 (0)