Skip to content

Commit

Permalink
Merge branch '3.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomii committed Jun 20, 2012
2 parents 5f39777 + 68ad899 commit 3231ac9
Show file tree
Hide file tree
Showing 86 changed files with 2,281 additions and 702 deletions.
2 changes: 1 addition & 1 deletion Samples/AsyncPagesMVC3/AsyncPagesMVC3/Global.asax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected void Application_Start()
Configure.WithWeb()
.DefaultBuilder()
.ForMvc()
.XmlSerializer()
.JsonSerializer()
.Log4Net()
.MsmqTransport()
.IsTransactional(false)
Expand Down
11 changes: 10 additions & 1 deletion Samples/AsyncPagesMVC3/Server/MessageEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

namespace Server
{
public class MessageEndpoint : IConfigureThisEndpoint, AsA_Server
public class MessageEndpoint : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization
{
/// <summary>
/// Perform initialization logic.
/// </summary>
public void Init()
{
Configure.With()
.DefaultBuilder()
.JsonSerializer();
}
}
}
26 changes: 25 additions & 1 deletion Samples/FullDuplex/MyServer/MyOwnUnitOfWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace MyServer

public class MyOwnUnitOfWork : IManageUnitsOfWork
{
public IMySession MySession { get; set; }

public void Begin()
{
LogMessage("Begin");
Expand All @@ -15,7 +17,10 @@ public void Begin()
public void End(Exception ex)
{
if (ex == null)
{
LogMessage("Commit");
MySession.SaveChanges();
}
else
LogMessage("Rollback, reason: " + ex);
}
Expand All @@ -26,11 +31,30 @@ void LogMessage(string message)
}
}

public interface IMySession
{
void SaveChanges();
}

public class ExampleSession:IMySession
{
public void SaveChanges()
{
Console.WriteLine(string.Format("ExampleSession({0}) - {1}", GetHashCode(), "Saving changes"));
}
}

public class UoWIntitializer : IWantCustomInitialization
{
public void Init()
{
Configure.Instance.Configurer.ConfigureComponent<MyOwnUnitOfWork>(DependencyLifecycle.InstancePerUnitOfWork);
Configure.Instance.Configurer.
ConfigureComponent<MyOwnUnitOfWork>(DependencyLifecycle.InstancePerUnitOfWork);

//this shows the new lambda feature introduced in NServiceBus 3.2.3
Configure.Instance.Configurer.
ConfigureComponent<IMySession>(()=> new ExampleSession(),DependencyLifecycle.InstancePerUnitOfWork);

}
}
}
16 changes: 16 additions & 0 deletions Samples/ScaleOut/Orders.Handler.Worker1/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
<section name="MasterNodeConfig" type="NServiceBus.Config.MasterNodeConfig, NServiceBus.Core" />
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core"/>
</configSections>

<MessageForwardingInCaseOfFaultConfig ErrorQueue="error"/>
<MasterNodeConfig Node="localhost"/>

<UnicastBusConfig
DistributorControlAddress="orders.handler.distributor.control@localhost"
DistributorDataAddress="orders.handler@localhost">
</UnicastBusConfig>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0217E112-7C44-4B6A-98AD-9031B9BC06DB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orders.Handler.Worker1</RootNamespace>
<AssemblyName>Orders.Handler.Worker1</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\binaries\log4net.dll</HintPath>
</Reference>
<Reference Include="NServiceBus">
<HintPath>..\..\..\binaries\NServiceBus.dll</HintPath>
</Reference>
<Reference Include="NServiceBus.Core">
<HintPath>..\..\..\binaries\NServiceBus.Core.dll</HintPath>
</Reference>
<Reference Include="NServiceBus.Host">
<HintPath>..\..\..\binaries\NServiceBus.Host.exe</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Orders.Handler\EndpointConfig.cs">
<Link>EndpointConfig.cs</Link>
</Compile>
<Compile Include="..\Orders.Handler\ProcessOrderCommandHandler.cs">
<Link>ProcessOrderCommandHandler.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Orders.Messages\Orders.Messages.csproj">
<Project>{162BEDCA-6C44-43B3-B2C1-83994BFFC094}</Project>
<Name>Orders.Messages</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<StartAction>Program</StartAction>
<StartProgram>$(ProjectDir)$(OutputPath)NServiceBus.Host.exe</StartProgram>
<StartArguments>NServiceBus.Production NServiceBus.Worker</StartArguments>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<StartAction>Program</StartAction>
<StartProgram>$(ProjectDir)$(OutputPath)NServiceBus.Host.exe</StartProgram>
<StartArguments>NServiceBus.Production NServiceBus.Worker</StartArguments>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
</Project>
36 changes: 36 additions & 0 deletions Samples/ScaleOut/Orders.Handler.Worker1/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Orders.Handler.Worker1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Orders.Handler.Worker1")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bd9897f9-efab-4cfb-9f9d-20c8aec903af")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EA6F9889-F2AE-4B87-8F0B-941B8428FC22}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orders.Handler.Worker2</RootNamespace>
<AssemblyName>Orders.Handler.Worker2</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\binaries\log4net.dll</HintPath>
</Reference>
<Reference Include="NServiceBus">
<HintPath>..\..\..\binaries\NServiceBus.dll</HintPath>
</Reference>
<Reference Include="NServiceBus.Core">
<HintPath>..\..\..\binaries\NServiceBus.Core.dll</HintPath>
</Reference>
<Reference Include="NServiceBus.Host">
<HintPath>..\..\..\binaries\NServiceBus.Host.exe</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Orders.Handler\EndpointConfig.cs">
<Link>EndpointConfig.cs</Link>
</Compile>
<Compile Include="..\Orders.Handler\ProcessOrderCommandHandler.cs">
<Link>ProcessOrderCommandHandler.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\Orders.Handler.Worker1\App.config">
<Link>App.config</Link>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Orders.Messages\Orders.Messages.csproj">
<Project>{162BEDCA-6C44-43B3-B2C1-83994BFFC094}</Project>
<Name>Orders.Messages</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<StartAction>Program</StartAction>
<StartProgram>$(ProjectDir)$(OutputPath)NServiceBus.Host.exe</StartProgram>
<StartArguments>NServiceBus.Production NServiceBus.Worker</StartArguments>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<StartAction>Program</StartAction>
<StartProgram>$(ProjectDir)$(OutputPath)NServiceBus.Host.exe</StartProgram>
<StartArguments>NServiceBus.Production NServiceBus.Worker</StartArguments>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
</Project>
36 changes: 36 additions & 0 deletions Samples/ScaleOut/Orders.Handler.Worker2/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Orders.Handler.Worker2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Orders.Handler.Worker2")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("08618f51-b46e-4a67-b4aa-5012df2e2147")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
36 changes: 2 additions & 34 deletions Samples/ScaleOut/Orders.Handler/App.config
Original file line number Diff line number Diff line change
@@ -1,42 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
<!-- Uncomment the following line when starting the Orders.Handler as Worker node. See http://nservicebus.com/Distributor.aspx for more information -->
<!-- <section name="MasterNodeConfig" type="NServiceBus.Config.MasterNodeConfig, NServiceBus.Core" />-->
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core"/>
</configSections>

<MessageForwardingInCaseOfFaultConfig ErrorQueue="error"/>
<!-- Uncomment the following line when starting the Orders.Handler as Worker node. See http://nservicebus.com/Distributor.aspx for more information -->
<!--<MasterNodeConfig Node="HostNameWhereMasterNodeIsRunning"/>-->

<log4net debug="false">
<appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
<mapping>
<level value="ERROR" />
<foreColor value="Red, HighIntensity" />
</mapping>
<mapping>
<level value="WARN" />
<foreColor value="Yellow, HighIntensity" />
</mapping>
<mapping>
<level value="INFO" />
<foreColor value="White" />
</mapping>
<mapping>
<level value="DEBUG" />
<foreColor value="Green" />
</mapping>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
<root>
<level value="INFO"/>
<appender-ref ref="ColoredConsoleAppender"/>
</root>
</log4net>

<MsmqTransportConfig NumberOfWorkerThreads="7" MaxRetries="2"/>
</configuration>
Loading

0 comments on commit 3231ac9

Please sign in to comment.