Permalink
Browse files

Initial Checkin of samples

  • Loading branch information...
1 parent 9511fb9 commit be19e511a599510163ba623bfe38ba2797d36a53 @DonMcRae DonMcRae committed Sep 15, 2011
Showing with 3,614 additions and 0 deletions.
  1. +32 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.BrokerConfiguration/Program.cs
  2. +36 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.BrokerConfiguration/Properties/AssemblyInfo.cs
  3. +120 −0 ...Spring.Amqp.HelloWorld.BrokerConfiguration/Spring.Amqp.HelloWorld.BrokerConfiguration.2010.csproj
  4. +17 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.BrokerConfiguration/app.config
  5. +6 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.BrokerConfiguration/packages.config
  6. +50 −0 ...HelloWorld/Spring.Amqp.HelloWorld.Consumer.Async/Spring.Amqp.HelloWorld.Consumer.Async/App.config
  7. +16 −0 ...pring.Amqp.HelloWorld.Consumer.Async/Spring.Amqp.HelloWorld.Consumer.Async/Config/Application.xml
  8. +42 −0 .../Spring.Amqp.HelloWorld.Consumer.Async/Spring.Amqp.HelloWorld.Consumer.Async/HelloWorldHandler.cs
  9. +32 −0 ...HelloWorld/Spring.Amqp.HelloWorld.Consumer.Async/Spring.Amqp.HelloWorld.Consumer.Async/Program.cs
  10. +36 −0 ...g.Amqp.HelloWorld.Consumer.Async/Spring.Amqp.HelloWorld.Consumer.Async/Properties/AssemblyInfo.cs
  11. +119 −0 ...mer.Async/Spring.Amqp.HelloWorld.Consumer.Async/Spring.Amqp.HelloWorld.Consumer.Async.2010.csproj
  12. +6 −0 ...World/Spring.Amqp.HelloWorld.Consumer.Async/Spring.Amqp.HelloWorld.Consumer.Async/packages.config
  13. +51 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Consumer/App.config
  14. +16 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Consumer/Config/Application.xml
  15. +54 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Consumer/Program.cs
  16. +36 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Consumer/Properties/AssemblyInfo.cs
  17. +119 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Consumer/Spring.Amqp.HelloWorld.Consumer.2010.csproj
  18. +6 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Consumer/packages.config
  19. +51 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer.Async/App.config
  20. +12 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer.Async/Config/Application.xml
  21. +43 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer.Async/Program.cs
  22. +36 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer.Async/Properties/AssemblyInfo.cs
  23. +123 −0 ...elloWorld/Spring.Amqp.HelloWorld.Producer.Async/Spring.Amqp.HelloWorld.Producer.Async.2010.csproj
  24. +7 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer.Async/packages.config
  25. +51 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer/App.config
  26. +15 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer/Config/Application.xml
  27. +48 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer/Program.cs
  28. +36 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer/Properties/AssemblyInfo.cs
  29. +120 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer/Spring.Amqp.HelloWorld.Producer.2010.csproj
  30. +6 −0 Spring.Amqp.HelloWorld/Spring.Amqp.HelloWorld.Producer/packages.config
  31. +44 −0 Spring.RabbitQuickStart/Spring.RabbitQuickStart.2010.sln
  32. +2 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.BrokerConfiguration/.gitignore
  33. +31 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.BrokerConfiguration/Program.cs
  34. +36 −0 ...abbitQuickStart/src/Spring/Spring.RabbitQuickStart.BrokerConfiguration/Properties/AssemblyInfo.cs
  35. +120 −0 ...ring.RabbitQuickStart.BrokerConfiguration/Spring.RabbitQuickStart.BrokerConfiguration.2010.csproj
  36. +27 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.BrokerConfiguration/app.config
  37. +6 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.BrokerConfiguration/packages.config
  38. +61 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/App.config
  39. +15 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/Config/Application.xml
  40. +51 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/Config/Messaging.xml
  41. +31 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/Gateways/IStockService.cs
  42. +38 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/Gateways/ISyncStockService.cs
  43. +42 −0 ....RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/Gateways/RabbitStockServiceGateway.cs
  44. +66 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/Handlers/StockAppHandler.cs
  45. +73 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/Program.cs
  46. +36 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/Properties/AssemblyInfo.cs
  47. +159 −0 ...itQuickStart/src/Spring/Spring.RabbitQuickStart.Client/Spring.RabbitQuickStart.Client.2010.csproj
  48. +75 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/UI/StockController.cs
  49. +79 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/UI/StockForm.cs
  50. +106 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/UI/StockForm.designer.cs
  51. +120 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/UI/StockForm.resx
  52. +8 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Client/packages.config
  53. +125 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Common/Data/TradeRequest.cs
  54. +116 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Common/Data/TradeResponse.cs
  55. +36 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Common/Properties/AssemblyInfo.cs
  56. +90 −0 ...itQuickStart/src/Spring/Spring.RabbitQuickStart.Common/Spring.RabbitQuickStart.Common.2010.csproj
  57. +62 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/App.config
  58. +11 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Config/Handlers.xml
  59. +43 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Config/Messaging.xml
  60. +10 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Config/ServiceStubs.xml
  61. +7 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Gateways/IMarketDataService.cs
  62. +67 −0 ...g.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Gateways/MarketDataServiceGateway.cs
  63. +25 −0 ...g.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Handlers/LoggingExceptionListener.cs
  64. +51 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Handlers/StockAppHandler.cs
  65. +42 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Program.cs
  66. +36 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Properties/AssemblyInfo.cs
  67. +32 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Services/ICreditCheckService.cs
  68. +31 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Services/IExecutionVenueService.cs
  69. +31 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Services/ITradingService.cs
  70. +15 −0 ...bbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Services/Stubs/CreditCheckServiceStub.cs
  71. +46 −0 ...tQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Services/Stubs/ExecutionVenueServiceStub.cs
  72. +12 −0 ...g.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Services/Stubs/TradingServiceStub.cs
  73. +150 −0 ...itQuickStart/src/Spring/Spring.RabbitQuickStart.Server/Spring.RabbitQuickStart.Server.2010.csproj
  74. +8 −0 Spring.RabbitQuickStart/src/Spring/Spring.RabbitQuickStart.Server/packages.config
@@ -0,0 +1,32 @@
+#region
+
+using System;
+using Spring.Messaging.Amqp.Core;
+using Spring.Messaging.Amqp.Rabbit.Connection;
+using Spring.Messaging.Amqp.Rabbit.Core;
+
+#endregion
+
+namespace Spring.Amqp.HelloWorld.BrokerConfiguration
+{
+ internal class Program
+ {
+ private static void Main(string[] args)
+ {
+ using (IConnectionFactory connectionFactory = new SingleConnectionFactory())
+ {
+ IAmqpAdmin amqpAdmin = new RabbitAdmin(connectionFactory);
+
+ var helloWorldQueue = new Queue("hello.world.queue");
+
+ amqpAdmin.DeclareQueue(helloWorldQueue);
+
+ //Each queue is automatically bound to the default direct exchange.
+
+ Console.WriteLine("Queue [hello.world.queue] has been declared.");
+ Console.WriteLine("Press 'enter' to exit");
+ Console.ReadLine();
+ }
+ }
+ }
+}
@@ -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("Spring.Amqp.HelloWorld.BrokerConfiguration")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Spring.Amqp.HelloWorld.BrokerConfiguration")]
+[assembly: AssemblyCopyright("Copyright © 2010")]
+[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("acfe68ff-75c2-42ca-9134-04170a782e26")]
+
+// 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")]
@@ -0,0 +1,120 @@
+<?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>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{5B53C793-9BB7-4B76-AF93-64AB842C95AD}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Spring.Amqp.HelloWorld.BrokerConfiguration</RootNamespace>
+ <AssemblyName>Spring.Amqp.HelloWorld.BrokerConfiguration</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <UpgradeBackupLocation />
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetFrameworkProfile />
+ </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>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </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>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Common.Logging">
+ <HintPath>..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll</HintPath>
+ </Reference>
+ <Reference Include="RabbitMQ.Client">
+ <HintPath>..\..\..\packages\RabbitMQ.Client.2.5.1\lib\net30\RabbitMQ.Client.dll</HintPath>
+ </Reference>
+ <Reference Include="Spring.Core">
+ <HintPath>..\..\..\packages\Spring.Core.1.3.2\lib\net40\Spring.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\src\Spring.Erlang\Spring.Erlang.2010.csproj">
+ <Project>{2619BBAC-1C37-4AE7-923F-E40EB7805132}</Project>
+ <Name>Spring.Erlang.2010</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\src\Spring.Messaging.Amqp.Rabbit.Admin\Spring.Messaging.Amqp.Rabbit.Admin.2010.csproj">
+ <Project>{EBC1D070-FC8A-4EAD-B2A7-3AC25AB62507}</Project>
+ <Name>Spring.Messaging.Amqp.Rabbit.Admin.2010</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\src\Spring.Messaging.Amqp.Rabbit\Spring.Messaging.Amqp.Rabbit.2010.csproj">
+ <Project>{1B1394DA-24D3-47FE-84CA-7E33B077F686}</Project>
+ <Name>Spring.Messaging.Amqp.Rabbit.2010</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\src\Spring.Messaging.Amqp\Spring.Messaging.Amqp.2010.csproj">
+ <Project>{96CD9010-9DDF-4D13-892A-5D60F01F3C90}</Project>
+ <Name>Spring.Messaging.Amqp.2010</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>
+ -->
+</Project>
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
+ </startup>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Common.Logging"
+ publicKeyToken="AF08829B84F0328E" />
+ <bindingRedirect oldVersion="1.2.0.0"
+ newVersion="2.0.0.0"/>
+ </dependentAssembly>
+ </assemblyBinding>
+
+ </runtime>
+</configuration>
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="RabbitMQ.Client" version="2.5.1" />
+ <package id="Common.Logging" version="2.0.0" />
+ <package id="Spring.Core" version="1.3.2" />
+</packages>
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <configSections>
+ <sectionGroup name="spring">
+ <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
+ </sectionGroup>
+ <sectionGroup name="common">
+ <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
+ </sectionGroup>
+ </configSections>
+ <spring>
+ <context>
+ <resource uri="~/Config/Application.xml" />
+ </context>
+ </spring>
+ <common>
+ <logging>
+ <factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
+ <arg key="showLogName" value="true" />
+ <arg key="showDataTime" value="true" />
+ <arg key="level" value="INFO" />
+ <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" />
+ </factoryAdapter>
+ </logging>
+ </common>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
+ </startup>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Spring.Aop" publicKeyToken="65e474d141e25e07" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.3.1.40711" newVersion="1.3.1.40711" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Spring.Core" publicKeyToken="65e474d141e25e07" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.3.1.40711" newVersion="1.3.1.40711" />
+ </dependentAssembly>
+ </assemblyBinding>
+
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Common.Logging"
+ publicKeyToken="AF08829B84F0328E" />
+ <bindingRedirect oldVersion="1.2.0.0"
+ newVersion="2.0.0.0"/>
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<objects xmlns="http://www.springframework.net">
+ <object id="ConnectionFactory" type="Spring.Messaging.Amqp.Rabbit.Connection.SingleConnectionFactory, Spring.Messaging.Amqp.Rabbit">
+ <!--<property name="Host" value="rabbit-server-hostname-here" />-->
+ </object>
+ <object id="MessageListenerContainer" type="Spring.Messaging.Amqp.Rabbit.Listener.SimpleMessageListenerContainer, Spring.Messaging.Amqp.Rabbit" init-method="Start">
+ <property name="ConnectionFactory" ref="ConnectionFactory" />
+ <property name="QueueNames" value="hello.world.queue" />
+ <property name="ConcurrentConsumers" value="5" />
+ <property name="MessageListener" ref="MessageListenerAdapter" />
+ </object>
+ <object id="MessageListenerAdapter" type="Spring.Messaging.Amqp.Rabbit.Listener.Adapter.MessageListenerAdapter, Spring.Messaging.Amqp.Rabbit">
+ <property name="HandlerObject" ref="HelloWorldHandler" />
+ </object>
+ <object id="HelloWorldHandler" type="Spring.Amqp.HelloWorld.Consumer.Async.HelloWorldHandler, Spring.Amqp.HelloWorld.Consumer.Async"></object>
+</objects>
@@ -0,0 +1,42 @@
+
+#region License
+
+/*
+ * Copyright 2002-2010 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#endregion
+
+using System;
+
+namespace Spring.Amqp.HelloWorld.Consumer.Async
+{
+ /// <summary>
+ /// A sample asynchronous message handler.
+ /// </summary>
+ /// <remarks></remarks>
+ public class HelloWorldHandler
+ {
+ /// <summary>
+ /// Handles the message.
+ /// </summary>
+ /// <param name="text">The text.</param>
+ /// <remarks></remarks>
+ public void HandleMessage(string text)
+ {
+ Console.WriteLine("Received: " + text);
+ }
+ }
+}
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Common.Logging;
+using Spring.Context;
+using Spring.Context.Support;
+using Spring.Messaging.Amqp.Core;
+
+namespace Spring.Amqp.HelloWorld.Consumer.Async
+{
+ /// <summary>
+ /// A sample asynchronous consumer.
+ /// </summary>
+ /// <remarks></remarks>
+ class Program
+ {
+ /// <summary>
+ /// Starts the program.
+ /// </summary>
+ /// <param name="args">The args.</param>
+ /// <remarks></remarks>
+ public static void Main(string[] args)
+ {
+ var ctx = ContextRegistry.GetContext();
+ Console.Out.WriteLine("Consumer listening...");
+ Console.Out.WriteLine("--- Press <return> to quit ---");
+ Console.ReadLine();
+ Console.Out.WriteLine("--- return pressed ---");
+ ctx.Dispose();
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit be19e51

Please sign in to comment.