Skip to content

Commit 525e3da

Browse files
committed
Initial Source
1 parent 5d07fc0 commit 525e3da

File tree

60 files changed

+19892
-0
lines changed

Some content is hidden

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

60 files changed

+19892
-0
lines changed

.hgignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
syntax: glob
2+
#ignore outputs of project
3+
BuildOutput*/
4+
TestResults*/
5+
#ignore thumbnails created by windows
6+
Thumbs.db
7+
#Ignore files build by Visual Studio
8+
*.obj
9+
*.user
10+
*.aps
11+
*.pch
12+
*.vspscc
13+
*_i.c
14+
*_p.c
15+
*.ncb
16+
*.suo
17+
*.tlb
18+
*.tlh
19+
*.bak
20+
*.cache
21+
*.ilk
22+
*.log
23+
*.orig
24+
[Bb]in
25+
[Dd]ebug*/
26+
*.lib
27+
*.sbr
28+
obj/
29+
[Rr]elease*/
30+
doc/
31+
_ReSharper*/
32+
[Tt]est[Rr]esult*
33+
zzz_*
34+
Files/temp/**
35+
_[Bb]ackup*/*
36+
_[Uu]pgrade*/*
37+
relre:/*.ReSharper
38+
packages/*/*
39+
src/*.exe.config
40+
.git/**

ClickToBuild.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
call build.bat
2+
pause
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata>
4+
<id>ProjectExtensions.Azure.ServiceBus</id>
5+
<title>ProjectExtensions.Azure.ServiceBus</title>
6+
<version>0.1.0.0</version>
7+
<authors>ProjectExtensions, Joe Feser</authors>
8+
<owners>ProjectExtensions, Joe Feser</owners>
9+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
10+
<description>TODO description</description>
11+
<summary>Azure ServiceBus Wrapper modeled after the NServiceBus pattern of IHandleMessage&lt;T&gt; (Debug)</summary>
12+
<dependencies>
13+
</dependencies>
14+
<tags>Azure, ServiceBus</tags>
15+
</metadata>
16+
<files>
17+
<file src="BuildOutput\bin\ProjectExtensions.Azure.ServiceBus.dll" target="lib\net40-full" />
18+
<file src="BuildOutput\bin\ProjectExtensions.Azure.ServiceBus.pdb" target="lib\net40-full" />
19+
<file src="BuildOutput\src\*.cs" target="src" />
20+
<file src="BuildOutput\src\ProjectExtensions.Azure.ServiceBus\**\*.cs" target="src\ProjectExtensions.Azure.ServiceBus" />
21+
</files>
22+
</package>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectExtensions.Azure.ServiceBus", "src\ProjectExtensions.Azure.ServiceBus\ProjectExtensions.Azure.ServiceBus.csproj", "{8C8A8531-95AE-41CD-B2AC-6651F104245E}"
5+
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectExtensions.Azure.ServiceBus.Tests.Unit", "src\Tests\ProjectExtensions.Azure.ServiceBus.Tests.Unit\ProjectExtensions.Azure.ServiceBus.Tests.Unit.csproj", "{7B5EB3D2-771D-467C-B467-60BF2065890D}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D6905EEE-FEC0-4DB4-9D35-641FA79F7A12}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectExtensions.Azure.ServiceBus.Tests.Integration", "src\Tests\ProjectExtensions.Azure.ServiceBus.Tests.Integration\ProjectExtensions.Azure.ServiceBus.Tests.Integration.csproj", "{5CA360A8-B3D1-4470-BD73-11F96082E62C}"
11+
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{13C615E7-0790-486F-90CB-3F0EE0981ECB}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PubSubUsingConfiguration", "src\Samples\PubSubUsingConfiguration\PubSubUsingConfiguration.csproj", "{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}"
15+
EndProject
16+
Global
17+
GlobalSection(MercurialSourceControlSolutionProperties) = preSolution
18+
SolutionIsControlled = True
19+
SolutionBindings = <Solution Location In Database>
20+
EndGlobalSection
21+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
22+
Debug|Any CPU = Debug|Any CPU
23+
Debug|Mixed Platforms = Debug|Mixed Platforms
24+
Debug|x86 = Debug|x86
25+
Release|Any CPU = Release|Any CPU
26+
Release|Mixed Platforms = Release|Mixed Platforms
27+
Release|x86 = Release|x86
28+
EndGlobalSection
29+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
30+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Debug|Any CPU.Build.0 = Debug|Any CPU
32+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
33+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
34+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Debug|x86.ActiveCfg = Debug|Any CPU
35+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Release|Any CPU.ActiveCfg = Release|Any CPU
36+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
38+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
39+
{8C8A8531-95AE-41CD-B2AC-6651F104245E}.Release|x86.ActiveCfg = Release|Any CPU
40+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Debug|Any CPU.Build.0 = Debug|Any CPU
42+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
43+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
44+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Debug|x86.ActiveCfg = Debug|Any CPU
45+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Release|Any CPU.ActiveCfg = Release|Any CPU
46+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Release|Any CPU.Build.0 = Release|Any CPU
47+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
48+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
49+
{7B5EB3D2-771D-467C-B467-60BF2065890D}.Release|x86.ActiveCfg = Release|Any CPU
50+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Debug|Any CPU.Build.0 = Debug|Any CPU
52+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
53+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
54+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Debug|x86.ActiveCfg = Debug|Any CPU
55+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Release|Any CPU.Build.0 = Release|Any CPU
57+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
58+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
59+
{5CA360A8-B3D1-4470-BD73-11F96082E62C}.Release|x86.ActiveCfg = Release|Any CPU
60+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Debug|Any CPU.ActiveCfg = Debug|x86
61+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
62+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Debug|Mixed Platforms.Build.0 = Debug|x86
63+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Debug|x86.ActiveCfg = Debug|x86
64+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Debug|x86.Build.0 = Debug|x86
65+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Release|Any CPU.ActiveCfg = Release|x86
66+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Release|Mixed Platforms.ActiveCfg = Release|x86
67+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Release|Mixed Platforms.Build.0 = Release|x86
68+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Release|x86.ActiveCfg = Release|x86
69+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62}.Release|x86.Build.0 = Release|x86
70+
EndGlobalSection
71+
GlobalSection(SolutionProperties) = preSolution
72+
HideSolutionNode = FALSE
73+
EndGlobalSection
74+
GlobalSection(NestedProjects) = preSolution
75+
{7B5EB3D2-771D-467C-B467-60BF2065890D} = {D6905EEE-FEC0-4DB4-9D35-641FA79F7A12}
76+
{5CA360A8-B3D1-4470-BD73-11F96082E62C} = {D6905EEE-FEC0-4DB4-9D35-641FA79F7A12}
77+
{2B545669-3B24-4805-B7B1-B7AA4E2B6A62} = {13C615E7-0790-486F-90CB-3F0EE0981ECB}
78+
EndGlobalSection
79+
EndGlobal

build.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
msbuild /verbosity:minimal %* build.proj

build.proj

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets ="Dist" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!-- See https://onpointondemand.fogbugz.com/default.asp?W695 for documentation -->
4+
<Import Project="$(MSBuildProjectDirectory)\Tools\MSBuild\BuildSupport\Onpoint.Targets.properties"/>
5+
6+
<!-- Version Information -->
7+
<PropertyGroup>
8+
<AppVersion>0.1.0</AppVersion>
9+
<SchemaVersion>0</SchemaVersion>
10+
</PropertyGroup>
11+
12+
<!-- Project name and description -->
13+
<PropertyGroup>
14+
<ProductName>ProjectExtensions.Azure.ServiceBus</ProductName>
15+
<ProductDescription>Azure ServiceBus Wrapper modeled after the NServiceBus pattern of IHandleMessage&lt;T&gt;</ProductDescription>
16+
</PropertyGroup>
17+
18+
<!-- NUnit Tests -->
19+
<ItemGroup>
20+
<NUnitTestItem Include="ProjectExtensions.Azure.ServiceBus.Tests.Unit"/>
21+
<NUnitTestItem Include="ProjectExtensions.Azure.ServiceBus.Tests.Integration"/>
22+
</ItemGroup>
23+
24+
<!-- Binary files to publish -->
25+
<PropertyGroup>
26+
<BinInclude>
27+
src\ProjectExtensions.Azure.ServiceBus\bin\$(Configuration)\*.*;
28+
</BinInclude>
29+
</PropertyGroup>
30+
31+
<!-- Source files to publish -->
32+
<PropertyGroup>
33+
<SrcInclude>
34+
src\**\*.cs;
35+
</SrcInclude>
36+
</PropertyGroup>
37+
38+
<!-- Source files to ignore -->
39+
<PropertyGroup>
40+
<SrcExclude>
41+
src\Tests\**\*.cs;
42+
</SrcExclude>
43+
</PropertyGroup>
44+
45+
<!-- Nuget v2 -->
46+
<ItemGroup>
47+
<NugetItem Include="ProjectExtensions.Azure.ServiceBus">
48+
<NugetPackageSummary>Azure ServiceBus Wrapper modeled after the NServiceBus pattern of IHandleMessage&lt;T&gt;</NugetPackageSummary>
49+
<NugetPackageId>ProjectExtensions.Azure.ServiceBus</NugetPackageId>
50+
<NugetPushUrl>http://go.microsoft.com/fwlink/?LinkID=207106</NugetPushUrl>
51+
<NugetPublishSymbols>true</NugetPublishSymbols>
52+
</NugetItem>
53+
</ItemGroup>
54+
55+
<Import Project="$(MSBuildProjectDirectory)\Tools\MSBuild\BuildSupport\Onpoint.Targets"/>
56+
</Project>
332 KB
Binary file not shown.

license.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright (c) 2011, Project Extensions and Joseph E. Feser
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
* Neither the name of the <organization> nor the
12+
names of its contributors may be used to endorse or promote products
13+
derived from this software without specific prior written permission.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
19+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

msbuild.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
%systemroot%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe %*

readme.txt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
=============================================
2+
ProjectExtensions.Azure.ServiceBus
3+
=============================================
4+
Use ClickToBuild.bat to build.
5+
6+
==Getting Started==
7+
8+
1. Create a console application
9+
2. Add a reference to ProjectExtensions.Azure.ServiceBus
10+
3. Optionally Add a reference to NLog
11+
4. Create a Message Class that you wish to handle:
12+
13+
public class TestMessage {
14+
15+
public string MessageId {
16+
get;
17+
set;
18+
}
19+
20+
public int Value {
21+
get;
22+
set;
23+
}
24+
}
25+
26+
5. Create a Handler that will receive notifications when the message is placed on the bus:
27+
28+
public class TestMessageSubscriber : IHandleMessages<TestMessage> {
29+
30+
static Logger logger = LogManager.GetCurrentClassLogger();
31+
32+
public void Handle(TestMessage message, IDictionary<string, object> metadata) {
33+
logger.Log(LogLevel.Info, "Message received: {0} {1}", message.Value, message.MessageId);
34+
}
35+
36+
public bool IsReusable {
37+
get {
38+
return false;
39+
}
40+
}
41+
42+
}
43+
44+
45+
6. Place this at the beginning of your method or in your BootStrapper
46+
47+
If you are going to use a config file, then set these properties
48+
49+
<add key="ServiceBusIssuerKey" value="base64hash" />
50+
<add key="ServiceBusIssuerName" value="owner" />
51+
//https://addresshere.servicebus.windows.net/
52+
<add key="ServiceBusNamespace" value="namespace set up in service bus (addresshere) portion" />
53+
54+
ProjectExtensions.Azure.ServiceBus.BusConfiguration.WithSettings()
55+
.ReadFromConfigFile()
56+
.ServiceBusApplicationId("AppName")
57+
.RegisterAssembly(typeof(TestMessageSubscriber).Assembly)
58+
.Configure();
59+
60+
Otherwise, you can configure everything in code:
61+
62+
ProjectExtensions.Azure.ServiceBus.BusConfiguration.WithSettings()
63+
.ReadFromConfigFile()
64+
.ServiceBusApplicationId("AppName")
65+
.ServiceBusIssuerKey("[sb password]")
66+
.ServiceBusIssuerName("owner")
67+
.ServiceBusNamespace("[addresshere]")
68+
.RegisterAssembly(typeof(TestMessageSubscriber).Assembly)
69+
.Configure();
70+
71+
7. Put some messages on the Bus:
72+
73+
for (int i = 0; i < 20; i++) {
74+
var message1 = new TestMessage() {
75+
Value = i,
76+
MessageId = DateTime.Now.ToString()
77+
};
78+
BusConfiguration.Instance.Bus.Publish(message1, null);
79+
}
80+
81+
Watch your method get called.
82+
83+
Welcome to Azure Service Bus.
84+
85+
@joefeser

src/CommonAssemblyInfo.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by a tool.
4+
// Runtime Version:4.0.30319.454
5+
//
6+
// Changes to this file may cause incorrect behavior and will be lost if
7+
// the code is regenerated.
8+
// </auto-generated>
9+
//------------------------------------------------------------------------------
10+
11+
using System;
12+
using System.Reflection;
13+
using System.Resources;
14+
using System.Runtime.CompilerServices;
15+
using System.Runtime.InteropServices;
16+
17+
[assembly: ComVisible(false)]
18+
[assembly: AssemblyVersion("0.1.0.0")]
19+
[assembly: AssemblyFileVersion("0.1.0.0")]
20+
[assembly: AssemblyCopyright("Copyright © Project Extensions 2011")]
21+
[assembly: AssemblyConfiguration("Debug")]
22+
[assembly: AssemblyCompany("Project Extensions")]
23+
[assembly: AssemblyProduct("Azure ServiceBus Wrapper modeled after the NServiceBus pattern of IHandleMessage<" +
24+
"T> (Debug DB: 0)")]
25+
26+

0 commit comments

Comments
 (0)