Skip to content

Commit 36f7ca1

Browse files
committed
Merge branch '3.3.1'
2 parents 02a7fdf + a0ae5c8 commit 36f7ca1

File tree

16 files changed

+258
-182
lines changed

16 files changed

+258
-182
lines changed

Samples/Gateway/Headquarter/UpdatePriceMessageHandler.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public void Handle(UpdatePrice message)
1616
{
1717
ProductId = message.ProductId,
1818
NewPrice = message.NewPrice,
19-
ValidFrom = message.ValidFrom
19+
ValidFrom = message.ValidFrom,
20+
SomeLargeString = new DataBusProperty<string>("A large string to demonstrate that the gateway supports databus properties")
2021
});
2122
}
2223
}

src/databus/NServiceBus.Databus.Tests/MessageWithDataBusProperty.cs

+5
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@ namespace NServiceBus.DataBus.Tests
33
public class MessageWithDataBusProperty : IMessage
44
{
55
public DataBusProperty<string> DataBusProperty { get; set; }
6+
}
7+
8+
public class MessageWithNullDataBusProperty : IMessage
9+
{
10+
public DataBusProperty<string> DataBusProperty { get; set; }
611
}
712
}
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,146 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>9.0.30729</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{DC1AC444-4F80-41D6-A320-99D37F5EA644}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>NServiceBus.DataBus.Tests</RootNamespace>
12-
<AssemblyName>NServiceBus.DataBus.Tests</AssemblyName>
13-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<FileUpgradeFlags>
16-
</FileUpgradeFlags>
17-
<OldToolsVersion>3.5</OldToolsVersion>
18-
<UpgradeBackupLocation />
19-
<PublishUrl>publish\</PublishUrl>
20-
<Install>true</Install>
21-
<InstallFrom>Disk</InstallFrom>
22-
<UpdateEnabled>false</UpdateEnabled>
23-
<UpdateMode>Foreground</UpdateMode>
24-
<UpdateInterval>7</UpdateInterval>
25-
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
26-
<UpdatePeriodically>false</UpdatePeriodically>
27-
<UpdateRequired>false</UpdateRequired>
28-
<MapFileExtensions>true</MapFileExtensions>
29-
<ApplicationRevision>0</ApplicationRevision>
30-
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
31-
<IsWebBootstrapper>false</IsWebBootstrapper>
32-
<UseApplicationTrust>false</UseApplicationTrust>
33-
<BootstrapperEnabled>true</BootstrapperEnabled>
34-
<TargetFrameworkProfile />
35-
</PropertyGroup>
36-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
37-
<DebugSymbols>true</DebugSymbols>
38-
<DebugType>full</DebugType>
39-
<Optimize>false</Optimize>
40-
<OutputPath>bin\Debug\</OutputPath>
41-
<DefineConstants>DEBUG;TRACE</DefineConstants>
42-
<ErrorReport>prompt</ErrorReport>
43-
<WarningLevel>4</WarningLevel>
44-
</PropertyGroup>
45-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
46-
<DebugType>pdbonly</DebugType>
47-
<Optimize>true</Optimize>
48-
<OutputPath>bin\Release\</OutputPath>
49-
<DefineConstants>TRACE</DefineConstants>
50-
<ErrorReport>prompt</ErrorReport>
51-
<WarningLevel>4</WarningLevel>
52-
</PropertyGroup>
53-
<ItemGroup>
54-
<Reference Include="log4net">
55-
<HintPath>..\..\..\lib\log4net.dll</HintPath>
56-
</Reference>
57-
<Reference Include="NServiceBus">
58-
<HintPath>..\..\..\build\output\NServiceBus.dll</HintPath>
59-
</Reference>
60-
<Reference Include="NServiceBus.Config, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
61-
<SpecificVersion>False</SpecificVersion>
62-
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.Config.dll</HintPath>
63-
</Reference>
64-
<Reference Include="NServiceBus.MessageHeaders">
65-
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.MessageHeaders.dll</HintPath>
66-
</Reference>
67-
<Reference Include="NServiceBus.MessageInterfaces">
68-
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.MessageInterfaces.dll</HintPath>
69-
</Reference>
70-
<Reference Include="NServiceBus.MessageInterfaces.MessageMapper.Reflection">
71-
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.MessageInterfaces.MessageMapper.Reflection.dll</HintPath>
72-
</Reference>
73-
<Reference Include="NServiceBus.MessageMutator">
74-
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.MessageMutator.dll</HintPath>
75-
</Reference>
76-
<Reference Include="NServiceBus.ObjectBuilder, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c, processorArchitecture=MSIL">
77-
<SpecificVersion>False</SpecificVersion>
78-
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll</HintPath>
79-
</Reference>
80-
<Reference Include="NServiceBus.ObjectBuilder.DefaultBuilder">
81-
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.DefaultBuilder.dll</HintPath>
82-
</Reference>
83-
<Reference Include="nunit.framework">
84-
<HintPath>..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
85-
</Reference>
86-
<Reference Include="nunit.mocks">
87-
<HintPath>..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
88-
</Reference>
89-
<Reference Include="pnunit.framework">
90-
<HintPath>..\..\..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
91-
</Reference>
92-
<Reference Include="Rhino.Mocks, Version=3.6.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
93-
<HintPath>..\..\..\packages\RhinoMocks.3.6\lib\Rhino.Mocks.dll</HintPath>
94-
</Reference>
95-
<Reference Include="System" />
96-
<Reference Include="System.Core">
97-
</Reference>
98-
</ItemGroup>
99-
<ItemGroup>
100-
<Compile Include="InMemoryDataBus.cs" />
101-
<Compile Include="MessageWithDataBusProperty.cs" />
102-
<Compile Include="MessageWithExplicitTimeToLive.cs" />
103-
<Compile Include="MessageWithNonSerializableDataBusProperty.cs" />
104-
<Compile Include="MessageWithoutDataBusProperty.cs" />
105-
<Compile Include="on_the_bus.cs" />
106-
<Compile Include="When_applying_the_databus_message_mutator_to_incoming_messages.cs" />
107-
<Compile Include="When_applying_the_databus_message_mutator_to_outgoing_messages.cs" />
108-
<Compile Include="Properties\AssemblyInfo.cs" />
109-
<Compile Include="When_nservicebus_is_initalizing.cs" />
110-
</ItemGroup>
111-
<ItemGroup>
112-
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
113-
<Visible>False</Visible>
114-
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
115-
<Install>false</Install>
116-
</BootstrapperPackage>
117-
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
118-
<Visible>False</Visible>
119-
<ProductName>.NET Framework 3.5 SP1</ProductName>
120-
<Install>true</Install>
121-
</BootstrapperPackage>
122-
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
123-
<Visible>False</Visible>
124-
<ProductName>Windows Installer 3.1</ProductName>
125-
<Install>true</Install>
126-
</BootstrapperPackage>
127-
</ItemGroup>
128-
<ItemGroup>
129-
<ProjectReference Include="..\NServiceBus.Databus\NServiceBus.DataBus.csproj">
130-
<Project>{EDFCAFE5-9C1D-4339-9DC5-2CD899E9E605}</Project>
131-
<Name>NServiceBus.DataBus</Name>
132-
</ProjectReference>
133-
</ItemGroup>
134-
<ItemGroup>
135-
<None Include="packages.config" />
136-
</ItemGroup>
137-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>9.0.30729</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{DC1AC444-4F80-41D6-A320-99D37F5EA644}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>NServiceBus.DataBus.Tests</RootNamespace>
12+
<AssemblyName>NServiceBus.DataBus.Tests</AssemblyName>
13+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<FileUpgradeFlags>
16+
</FileUpgradeFlags>
17+
<OldToolsVersion>3.5</OldToolsVersion>
18+
<UpgradeBackupLocation />
19+
<PublishUrl>publish\</PublishUrl>
20+
<Install>true</Install>
21+
<InstallFrom>Disk</InstallFrom>
22+
<UpdateEnabled>false</UpdateEnabled>
23+
<UpdateMode>Foreground</UpdateMode>
24+
<UpdateInterval>7</UpdateInterval>
25+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
26+
<UpdatePeriodically>false</UpdatePeriodically>
27+
<UpdateRequired>false</UpdateRequired>
28+
<MapFileExtensions>true</MapFileExtensions>
29+
<ApplicationRevision>0</ApplicationRevision>
30+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
31+
<IsWebBootstrapper>false</IsWebBootstrapper>
32+
<UseApplicationTrust>false</UseApplicationTrust>
33+
<BootstrapperEnabled>true</BootstrapperEnabled>
34+
<TargetFrameworkProfile />
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
37+
<DebugSymbols>true</DebugSymbols>
38+
<DebugType>full</DebugType>
39+
<Optimize>false</Optimize>
40+
<OutputPath>bin\Debug\</OutputPath>
41+
<DefineConstants>DEBUG;TRACE</DefineConstants>
42+
<ErrorReport>prompt</ErrorReport>
43+
<WarningLevel>4</WarningLevel>
44+
</PropertyGroup>
45+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
46+
<DebugType>pdbonly</DebugType>
47+
<Optimize>true</Optimize>
48+
<OutputPath>bin\Release\</OutputPath>
49+
<DefineConstants>TRACE</DefineConstants>
50+
<ErrorReport>prompt</ErrorReport>
51+
<WarningLevel>4</WarningLevel>
52+
</PropertyGroup>
53+
<ItemGroup>
54+
<Reference Include="log4net">
55+
<HintPath>..\..\..\lib\log4net.dll</HintPath>
56+
</Reference>
57+
<Reference Include="NServiceBus">
58+
<HintPath>..\..\..\build\output\NServiceBus.dll</HintPath>
59+
</Reference>
60+
<Reference Include="NServiceBus.Config, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
61+
<SpecificVersion>False</SpecificVersion>
62+
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.Config.dll</HintPath>
63+
</Reference>
64+
<Reference Include="NServiceBus.MessageHeaders">
65+
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.MessageHeaders.dll</HintPath>
66+
</Reference>
67+
<Reference Include="NServiceBus.MessageInterfaces">
68+
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.MessageInterfaces.dll</HintPath>
69+
</Reference>
70+
<Reference Include="NServiceBus.MessageInterfaces.MessageMapper.Reflection">
71+
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.MessageInterfaces.MessageMapper.Reflection.dll</HintPath>
72+
</Reference>
73+
<Reference Include="NServiceBus.MessageMutator">
74+
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.MessageMutator.dll</HintPath>
75+
</Reference>
76+
<Reference Include="NServiceBus.ObjectBuilder, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c, processorArchitecture=MSIL">
77+
<SpecificVersion>False</SpecificVersion>
78+
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll</HintPath>
79+
</Reference>
80+
<Reference Include="NServiceBus.ObjectBuilder.DefaultBuilder">
81+
<HintPath>..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.DefaultBuilder.dll</HintPath>
82+
</Reference>
83+
<Reference Include="nunit.framework">
84+
<HintPath>..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
85+
</Reference>
86+
<Reference Include="nunit.mocks">
87+
<HintPath>..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
88+
</Reference>
89+
<Reference Include="pnunit.framework">
90+
<HintPath>..\..\..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
91+
</Reference>
92+
<Reference Include="Rhino.Mocks, Version=3.6.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
93+
<HintPath>..\..\..\packages\RhinoMocks.3.6\lib\Rhino.Mocks.dll</HintPath>
94+
</Reference>
95+
<Reference Include="System" />
96+
<Reference Include="System.Core">
97+
</Reference>
98+
</ItemGroup>
99+
<ItemGroup>
100+
<Compile Include="InMemoryDataBus.cs" />
101+
<Compile Include="MessageWithDataBusProperty.cs" />
102+
<Compile Include="MessageWithExplicitTimeToLive.cs" />
103+
<Compile Include="MessageWithNonSerializableDataBusProperty.cs" />
104+
<Compile Include="MessageWithoutDataBusProperty.cs" />
105+
<Compile Include="on_the_bus.cs" />
106+
<Compile Include="When_applying_the_databus_message_mutator_to_incoming_messages.cs" />
107+
<Compile Include="When_applying_the_databus_message_mutator_to_null_properties.cs" />
108+
<Compile Include="When_applying_the_databus_message_mutator_to_outgoing_messages.cs" />
109+
<Compile Include="Properties\AssemblyInfo.cs" />
110+
<Compile Include="When_nservicebus_is_initalizing.cs" />
111+
</ItemGroup>
112+
<ItemGroup>
113+
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
114+
<Visible>False</Visible>
115+
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
116+
<Install>false</Install>
117+
</BootstrapperPackage>
118+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
119+
<Visible>False</Visible>
120+
<ProductName>.NET Framework 3.5 SP1</ProductName>
121+
<Install>true</Install>
122+
</BootstrapperPackage>
123+
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
124+
<Visible>False</Visible>
125+
<ProductName>Windows Installer 3.1</ProductName>
126+
<Install>true</Install>
127+
</BootstrapperPackage>
128+
</ItemGroup>
129+
<ItemGroup>
130+
<ProjectReference Include="..\NServiceBus.Databus\NServiceBus.DataBus.csproj">
131+
<Project>{EDFCAFE5-9C1D-4339-9DC5-2CD899E9E605}</Project>
132+
<Name>NServiceBus.DataBus</Name>
133+
</ProjectReference>
134+
</ItemGroup>
135+
<ItemGroup>
136+
<None Include="packages.config" />
137+
</ItemGroup>
138+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
138139
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
139140
Other similar extension points exist, see Microsoft.Common.targets.
140141
<Target Name="BeforeBuild">
141142
</Target>
142143
<Target Name="AfterBuild">
143144
</Target>
144-
-->
145+
-->
145146
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace NServiceBus.DataBus.Tests
2-
{
2+
{
3+
using System;
34
using System.IO;
45
using System.Runtime.Serialization.Formatters.Binary;
56
using NUnit.Framework;
@@ -14,19 +15,24 @@ public void Incoming_databus_properties_should_be_hydrated()
1415
var message = new MessageWithDataBusProperty
1516
{
1617
DataBusProperty = new DataBusProperty<string>("not used in this test")
17-
};
18-
18+
};
19+
message.DataBusProperty.Key = Guid.NewGuid().ToString();
20+
21+
var databusKey = Guid.NewGuid().ToString();
22+
23+
message.SetHeader("NServiceBus.DataBus." + message.DataBusProperty.Key, databusKey);
24+
1925
using (var stream = new MemoryStream())
2026
{
2127
new BinaryFormatter().Serialize(stream, "test");
22-
stream.Position = 0;
23-
24-
dataBus.Stub(s => s.Get(message.DataBusProperty.Key)).Return(stream);
28+
stream.Position = 0;
29+
30+
dataBus.Stub(s => s.Get(databusKey)).Return(stream);
2531

2632
message = (MessageWithDataBusProperty) incomingMutator.MutateIncoming(message);
2733
}
2834
Assert.AreEqual(message.DataBusProperty.Value, "test");
2935
}
3036

31-
}
37+
}
3238
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace NServiceBus.DataBus.Tests
2+
{
3+
using System.IO;
4+
using System.Runtime.Serialization.Formatters.Binary;
5+
using NUnit.Framework;
6+
7+
[TestFixture]
8+
public class When_applying_the_databus_message_mutator_to_null_properties : on_the_bus
9+
{
10+
[Test]
11+
public void Should_not_blow_up()
12+
{
13+
var message = new MessageWithNullDataBusProperty();
14+
15+
outgoingMutator.MutateOutgoing(message);
16+
17+
using (var stream = new MemoryStream())
18+
{
19+
new BinaryFormatter().Serialize(stream, "test");
20+
stream.Position = 0;
21+
22+
incomingMutator.MutateIncoming(message);
23+
}
24+
25+
26+
}
27+
28+
}
29+
}

src/databus/NServiceBus.Databus/DataBusMessageMutator.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ object IMutateIncomingMessages.MutateIncoming(object message)
9090
headerKey = String.Format("{0}.{1}", message.GetType().FullName, property.Name);
9191
}
9292

93-
var dataBusKey = message.GetHeader(DATABUS_PREFIX + headerKey);
93+
var dataBusKey = message.GetHeader(DATABUS_PREFIX + headerKey);
94+
95+
if (string.IsNullOrEmpty(dataBusKey))
96+
continue;
9497

9598
using (var stream = dataBus.Get(dataBusKey))
9699
{

0 commit comments

Comments
 (0)