forked from Particular/NServiceBus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to the configuration and hosting story for azure - part 1
AsA_Worker (replaces AsA_Server and AsA_publisher) Added Development Profile AsA_Host will load assemblies from blob storage as a zip and start running them in a specific azure generic host process (very immature version)
- Loading branch information
yvesgoeleven
committed
Aug 19, 2011
1 parent
24469ed
commit 1da570a
Showing
47 changed files
with
1,159 additions
and
245 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/hosting/NServiceBus.Hosting.Azure.HostProcess/Arguments/HostArguments.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Linq; | ||
using Topshelf.Internal; | ||
using Topshelf.Internal.ArgumentParsing; | ||
|
||
namespace NServiceBus.Hosting.Azure.HostProcess | ||
{ | ||
internal class HostArguments | ||
{ | ||
public HostArguments(Parser.Args arguments) | ||
{ | ||
Help = GetArgument(arguments, "help") ?? GetArgument(arguments, "?"); | ||
ServiceName = GetArgument(arguments, "serviceName"); | ||
DisplayName = GetArgument(arguments, "displayName"); | ||
Description = GetArgument(arguments, "description"); | ||
EndpointConfigurationType = GetArgument(arguments, "endpointConfigurationType"); | ||
DependsOn = GetArgument(arguments, "dependsOn"); | ||
StartManually = GetArgument(arguments, "startManually"); | ||
Username = GetArgument(arguments, "username"); | ||
Password = GetArgument(arguments, "password"); | ||
} | ||
|
||
public IArgument Help { get; set; } | ||
public IArgument ServiceName { get; set; } | ||
public IArgument DisplayName { get; set; } | ||
public IArgument Description { get; set; } | ||
public IArgument EndpointConfigurationType { get; set; } | ||
public IArgument DependsOn { get; set; } | ||
public IArgument StartManually { get; set; } | ||
public IArgument Username { get; set; } | ||
public IArgument Password { get; set; } | ||
|
||
private static IArgument GetArgument(Parser.Args arguments, string key) | ||
{ | ||
IArgument argument = arguments.CustomArguments.Where(x => x.Key != null).SingleOrDefault(x => x.Key.ToUpper() == key.ToUpper()); | ||
|
||
if (argument != null) | ||
{ | ||
arguments.CustomArguments = arguments.CustomArguments.Except(new[] {argument}); | ||
} | ||
|
||
return argument; | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
src/hosting/NServiceBus.Hosting.Azure.HostProcess/Content/Help.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
NServiceBus Message Endpoint Host Service | ||
|
||
USAGE: | ||
NServiceBus.Hosting.Azure.HostProcess.exe [/install [/serviceName] | ||
[/displayName] | ||
[/description] | ||
[/endpointConfigurationType] | ||
[/instance] | ||
[/startManually] | ||
[/username] | ||
[/password]] | | ||
[/uninstall[/serviceName] | ||
[/instance]] | ||
|
||
OPTIONS: | ||
|
||
/install Install the message endpoint as a Windows service | ||
/serviceName Specify the service name for the installed service | ||
/displayName Friendly name for the installed service | ||
/description Description for the service | ||
/endpointConfigurationType Specify the type implementing IConfigureThisEndpoint that should be used | ||
/instance Specify the unique name of the service instance you wish to install | ||
ex: "NServiceBus.Host.exe /install /instance:Instance5" | ||
/startManually Specifies that the service should start manually | ||
/username Username for the account the service should run under | ||
/password Password for the service account | ||
|
||
If no service name is specified NServiceBus will use the full name of the | ||
endpoint configuration type (that which implements NServiceBus.IConfigureThisEndpoint) | ||
along with the version number of the assembly it is contained within, for example: | ||
|
||
MyPublisher.Endpoint_v1.0.0.0 | ||
|
||
The default for the display name is the same value as the service name, and the description | ||
defaults to a generic NServiceBus host description. | ||
|
||
You can also specify the endpoint configuration type in the file NServiceBus.Host.exe.config. | ||
This file is optional. | ||
|
||
If you don't specify the endpoint configuration type either in the command-line or in the | ||
NServiceBus.Host.exe.config file, all the DLLs in the runtime directory will be scanned | ||
for a type that implements NServiceBus.IConfigureThisEndpoint. | ||
|
||
If you set the service name and/or instance name during installation you will need to specify | ||
them when uninstalling them as well, ex: | ||
|
||
NServiceBus.Host.exe /uninstall /serviceName:"MyPublisher" /instance:Instance89 | ||
|
||
EXAMPLES: | ||
NServiceBus.Host.exe /install /serviceName:"MyPublisher" /displayName:"My Publisher Service" | ||
/description:"Service for publishing event messages" | ||
/endpointConfigurationType:"YourEndpointConfigType.YourNameSpace, YourAssembly" | ||
/username:"corp\serviceuser" | ||
/password:"p@ssw0rd!" NServiceBus.Production |
39 changes: 39 additions & 0 deletions
39
src/hosting/NServiceBus.Hosting.Azure.HostProcess/HostServiceLocator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.Practices.ServiceLocation; | ||
|
||
namespace NServiceBus.Hosting.Azure.HostProcess | ||
{ | ||
/// <summary> | ||
/// Plugs into the generic service locator to return an instance of <see cref="GenericHost"/>. | ||
/// </summary> | ||
public class HostServiceLocator : ServiceLocatorImplBase | ||
{ | ||
/// <summary> | ||
/// Command line arguments. | ||
/// </summary> | ||
public static string[] Args; | ||
|
||
/// <summary> | ||
/// Returns an instance of <see cref="GenericHost"/> | ||
/// </summary> | ||
/// <param name="serviceType"></param> | ||
/// <param name="key"></param> | ||
/// <returns></returns> | ||
protected override object DoGetInstance(Type serviceType, string key) | ||
{ | ||
var endpoint = Type.GetType(key,true); | ||
return new WindowsHost(endpoint, Args); | ||
} | ||
|
||
/// <summary> | ||
/// Not implemented. | ||
/// </summary> | ||
/// <param name="serviceType"></param> | ||
/// <returns></returns> | ||
protected override IEnumerable<object> DoGetAllInstances(Type serviceType) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
...osting/NServiceBus.Hosting.Azure.HostProcess/NServiceBus.Hosting.Azure.HostProcess.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?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)' == '' ">x86</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{11B81F23-64C6-4341-94AC-38B3C4C6B1E7}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>NServiceBus.Hosting.Azure.HostProcess</RootNamespace> | ||
<AssemblyName>NServiceBus.Hosting.Azure.HostProcess</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<TargetFrameworkProfile> | ||
</TargetFrameworkProfile> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<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|x86' "> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<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>..\..\..\lib\log4net.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Magnum"> | ||
<HintPath>..\..\..\lib\Topshelf\Magnum.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Microsoft.Practices.ServiceLocation"> | ||
<HintPath>..\..\..\lib\ServiceLocation\Microsoft.Practices.ServiceLocation.dll</HintPath> | ||
</Reference> | ||
<Reference Include="NServiceBus"> | ||
<HintPath>..\..\..\build\output\NServiceBus.dll</HintPath> | ||
</Reference> | ||
<Reference Include="NServiceBus.Azure"> | ||
<HintPath>..\..\..\build\output\NServiceBus.Azure.dll</HintPath> | ||
</Reference> | ||
<Reference Include="NServiceBus.Core"> | ||
<HintPath>..\..\..\build\output\NServiceBus.Core.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.configuration" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="Topshelf"> | ||
<HintPath>..\..\..\lib\Topshelf\Topshelf.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\CommonAssemblyInfo.cs"> | ||
<Link>CommonAssemblyInfo.cs</Link> | ||
</Compile> | ||
<Compile Include="Arguments\HostArguments.cs" /> | ||
<Compile Include="HostServiceLocator.cs" /> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="WindowsHost.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\NServiceBus.Hosting.Azure\NServiceBus.Hosting.Azure.csproj"> | ||
<Project>{6591ED91-F9A1-4CC3-813E-A33E07439D49}</Project> | ||
<Name>NServiceBus.Hosting.Azure</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\NServiceBus.Hosting\NServiceBus.Hosting.csproj"> | ||
<Project>{B5F333D1-D6B1-49FB-82F6-74641E5D11E3}</Project> | ||
<Name>NServiceBus.Hosting</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Include="Content\Help.txt" /> | ||
</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> | ||
--> | ||
</Project> |
Oops, something went wrong.