Skip to content

Commit 0f696f4

Browse files
authored
Merge pull request #6784 from Particular/databus-docs
Add obsolete warning to databus page
2 parents fed3341 + a214f33 commit 0f696f4

File tree

123 files changed

+1685
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1685
-65
lines changed

Snippets/BinaryDataBusSerializer/BinaryDataBusSerializer_1/Usage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ class Usage
55
{
66
Usage(EndpointConfiguration endpointConfiguration)
77
{
8-
#region BinaryDataBusUsage
98
#pragma warning disable CS0618 // Type or member is obsolete
9+
#region BinaryDataBusUsage
1010
endpointConfiguration.UseDataBus<FileShareDataBus, BinaryFormatterDataBusSerializer>();
11-
#pragma warning restore CS0618 // Type or member is obsolete
1211
#endregion
12+
#pragma warning restore CS0618 // Type or member is obsolete
1313
}
1414
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net48</TargetFramework>
4+
<RootNamespace>Core7</RootNamespace>
5+
<PlatformTarget>x64</PlatformTarget>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="2.*" />
9+
<PackageReference Include="NServiceBus" Version="7.*" />
10+
<PackageReference Include="NServiceBus.Autofac" Version="7.*" />
11+
<PackageReference Include="NServiceBus.Callbacks" Version="3.*" />
12+
<PackageReference Include="NServiceBus.Encryption.MessageProperty" Version="2.*" />
13+
<PackageReference Include="NServiceBus.Metrics.ServiceControl" Version="3.*" />
14+
<PackageReference Include="Newtonsoft.Json" Version="13.*" />
15+
<PackageReference Include="NUnit" Version="3.*" />
16+
<PackageReference Include="System.Reactive" Version="3.*" />
17+
<Reference Include="System.ServiceProcess" />
18+
<Reference Include="System.Web" />
19+
</ItemGroup>
20+
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+

2+
namespace Core7.DataBus.Conventions
3+
{
4+
5+
#region MessageWithLargePayloadUsingConvention
6+
7+
public class MessageWithLargePayload
8+
{
9+
public string SomeProperty { get; set; }
10+
public byte[] LargeBlobDataBus { get; set; }
11+
}
12+
13+
#endregion
14+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace Core7.DataBus.Conventions
2+
{
3+
using NServiceBus;
4+
5+
class Usage
6+
{
7+
Usage(EndpointConfiguration endpointConfiguration)
8+
{
9+
#region DefineMessageWithLargePayloadUsingConvention
10+
11+
var conventions = endpointConfiguration.Conventions();
12+
conventions.DefiningDataBusPropertiesAs(
13+
property => property.Name.EndsWith("DataBus"));
14+
15+
#endregion
16+
17+
}
18+
}
19+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
namespace Core7.DataBus.Custom
2+
{
3+
using System;
4+
using System.IO;
5+
using System.Threading.Tasks;
6+
using NServiceBus.DataBus;
7+
8+
#region CustomDataBus
9+
10+
class CustomDataBus :
11+
IDataBus
12+
{
13+
public Task<Stream> Get(string key)
14+
{
15+
Stream stream = File.OpenRead("blob.dat");
16+
return Task.FromResult(stream);
17+
}
18+
19+
public async Task<string> Put(Stream stream, TimeSpan timeToBeReceived)
20+
{
21+
using (var destination = File.OpenWrite("blob.dat"))
22+
{
23+
await stream.CopyToAsync(destination);
24+
}
25+
return "the-key-of-the-stored-file-such-as-the-full-path";
26+
}
27+
28+
public Task Start()
29+
{
30+
return Task.CompletedTask;
31+
}
32+
}
33+
34+
#endregion
35+
36+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace Core7.DataBus.Custom
2+
{
3+
using System;
4+
using NServiceBus.DataBus;
5+
6+
#region CustomDataBusDefinition
7+
class CustomDatabusDefinition : DataBusDefinition
8+
{
9+
protected override Type ProvidedByFeature()
10+
=> typeof(CustomDatabusFeature);
11+
}
12+
#endregion
13+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace Core7.DataBus.Custom
2+
{
3+
using NServiceBus;
4+
using NServiceBus.Features;
5+
6+
#region CustomDataBusFeature
7+
class CustomDatabusFeature : Feature
8+
{
9+
public CustomDatabusFeature()
10+
=> DependsOn<DataBus>();
11+
12+
protected override void Setup(FeatureConfigurationContext context)
13+
{
14+
context.Container.ConfigureComponent(typeof(CustomDataBus) , DependencyLifecycle.SingleInstance);
15+
}
16+
}
17+
#endregion
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace Core7.DataBus.Custom
2+
{
3+
using NServiceBus;
4+
5+
class Usage
6+
{
7+
Usage(EndpointConfiguration endpointConfiguration)
8+
{
9+
#region PluginCustomDataBus
10+
endpointConfiguration.UseDataBus(typeof(CustomDataBus));
11+
12+
#endregion
13+
}
14+
}
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace Core7.DataBus.DataBusProperty
2+
{
3+
using NServiceBus;
4+
5+
#region MessageWithLargePayload
6+
7+
public class MessageWithLargePayload
8+
{
9+
public string SomeProperty { get; set; }
10+
public DataBusProperty<byte[]> LargeBlob { get; set; }
11+
}
12+
13+
#endregion
14+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net48</TargetFramework>
4+
<RootNamespace>Core8</RootNamespace>
5+
<PlatformTarget>x64</PlatformTarget>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.7" />
9+
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="2.*" />
10+
<PackageReference Include="NServiceBus" Version="8.*" />
11+
<PackageReference Include="NServiceBus.Callbacks" Version="4.*" />
12+
<PackageReference Include="NServiceBus.Encryption.MessageProperty" Version="4.*" />
13+
<PackageReference Include="NServiceBus.Metrics.ServiceControl" Version="4.*" />
14+
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.*" />
15+
<PackageReference Include="Newtonsoft.Json" Version="13.*" />
16+
<PackageReference Include="NUnit" Version="3.*" />
17+
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
18+
<PackageReference Include="OpenTelemetry" Version="1.*" />
19+
<Reference Include="System.ServiceProcess" />
20+
<Reference Include="System.Web" />
21+
</ItemGroup>
22+
</Project>

0 commit comments

Comments
 (0)