You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2014/01/28 23:07:20 UTC
svn commit: r1562249 - in /activemq/activemq-dotnet/Apache.NMS.AMQP/trunk:
./ src/test/csharp/HelloWorld/ src/test/csharp/HelloWorld/Properties/
Author: tabish
Date: Tue Jan 28 22:07:19 2014
New Revision: 1562249
URL: http://svn.apache.org/r1562249
Log:
https://issues.apache.org/jira/browse/AMQNET-454
applied:
https://issues.apache.org/jira/secure/attachment/12625673/Apache.NMS.AMQP-add-hello-world-example-retry-12.patch
Added:
activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/
activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/HelloWorld.cs
activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/Properties/
activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/Properties/AssemblyInfo.cs (with props)
activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/app.config
activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-HelloWorld.csproj
Modified:
activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.sln
Added: activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/HelloWorld.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/HelloWorld.cs?rev=1562249&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/HelloWorld.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/HelloWorld.cs Tue Jan 28 22:07:19 2014
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+using System;
+using System.Diagnostics;
+using Apache.NMS;
+using Apache.NMS.Util;
+using Apache.NMS.Amqp;
+
+namespace Apache.NMS.ActiveMQ.Test
+{
+ public class TestMain
+ {
+ public static void HelloWorld_amqpBroker_0_10Protocol(string[] args)
+ {
+ // Connect to a qpid broker on localhost:5672
+ // Run HelloWorld using amqp0-10 protocol
+ //
+ // Notes:
+ // * Run qpidd on localhost
+ // * Ensure the nmsprovider-amqp.config file exists
+ // in the executable folder (build\net4-0\debug).
+ // * Ensure the unmanaged qpid*.dll and boost*.dll files from
+ // .nant\library\local\org.apache.qpid\Apache.Qpid\<version>\net-4.0\debug
+ // are in project's Output Path (build\net-4.0\debug) so that they may be
+ // loaded by org.apache.qpid.messaging.dll.
+
+ Uri connecturi = new Uri("amqp:localhost:5672");
+
+ IConnectionFactory factory = new NMSConnectionFactory(connecturi, "Bob", "reconnect-timeout:5", "protocol:amqp0-10");
+
+ using (IConnection connection = factory.CreateConnection())
+ using (ISession session = connection.CreateSession())
+ {
+ IDestination destination = SessionUtil.GetDestination(session, "amq.topic");
+
+ // Create a consumer and producer
+ using (IMessageConsumer consumer = session.CreateConsumer(destination))
+ using (IMessageProducer producer = session.CreateProducer(destination))
+ {
+ // Start the connection so that messages will be processed.
+ connection.Start();
+
+ // Create and send a message
+ ITextMessage request = session.CreateTextMessage("Hello World!");
+ request.Properties["NMSXGroupID"] = "cheese";
+ request.Properties["myHeader"] = "Cheddar";
+
+ producer.Send(request);
+
+ //// Consume a message
+ ITextMessage message = consumer.Receive() as ITextMessage;
+ if (message == null)
+ {
+ Console.WriteLine("No message received!");
+ }
+ else
+ {
+ // Expected output:
+ // Received message text: Hello World!
+ // Received message properties: {x-amqp-0-10.routing-key=, NMSXGroupID=cheese, myHeader=Cheddar}
+ Console.WriteLine("Received message text: " + message.Text);
+ Console.WriteLine("Received message properties: " + message.Properties.ToString());
+ }
+ connection.Stop();
+ }
+ }
+ }
+ public static void Main(string[] args)
+ {
+ HelloWorld_amqpBroker_0_10Protocol(args);
+ }
+ }
+}
\ No newline at end of file
Added: activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/Properties/AssemblyInfo.cs?rev=1562249&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/Properties/AssemblyInfo.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/Properties/AssemblyInfo.cs Tue Jan 28 22:07:19 2014
@@ -0,0 +1,55 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you 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.
+//
+
+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("NMS-HelloWorld-v2")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("NMS-HelloWorld-v2")]
+[assembly: AssemblyCopyright("Copyright © 2013")]
+[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("801a4b62-ecc6-42a0-80c6-812a1b4037e2")]
+
+// 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")]
\ No newline at end of file
Propchange: activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/Properties/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/app.config
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/app.config?rev=1562249&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/app.config (added)
+++ activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/test/csharp/HelloWorld/app.config Tue Jan 28 22:07:19 2014
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
Added: activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-HelloWorld.csproj
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-HelloWorld.csproj?rev=1562249&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-HelloWorld.csproj (added)
+++ activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-HelloWorld.csproj Tue Jan 28 22:07:19 2014
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<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>{AC7C231F-0539-4612-A521-27CD9E00352B}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>vs2010_HelloWorld</RootNamespace>
+ <AssemblyName>vs2010-HelloWorld</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>build\net-4.0\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>build\net-4.0\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Apache.NMS">
+ <HintPath>lib\Apache.NMS\net-4.0\Apache.NMS.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="src\test\csharp\HelloWorld\HelloWorld.cs" />
+ <Compile Include="src\test\csharp\HelloWorld\Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="src\test\csharp\HelloWorld\app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="vs2010-amqp.csproj">
+ <Project>{5E1E5956-2AC0-4134-BA91-CE3A13268432}</Project>
+ <Name>vs2010-amqp</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>
\ No newline at end of file
Modified: activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.sln
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.sln?rev=1562249&r1=1562248&r2=1562249&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.sln (original)
+++ activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.sln Tue Jan 28 22:07:19 2014
@@ -3,22 +3,50 @@ Microsoft Visual Studio Solution File, F
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs2010-amqp", "vs2010-amqp.csproj", "{5E1E5956-2AC0-4134-BA91-CE3A13268432}"
EndProject
-Project("{F1F98A1F-7408-4B74-AD3A-B5C9997F6DC3}") = "vs2010-amqp-test", "vs2010-amqp-test.csproj", "{E7A4FA3E-6106-470C-99A6-B59C8340F7DB}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs2010-amqp-test", "vs2010-amqp-test.csproj", "{E7A4FA3E-6106-470C-99A6-B59C8340F7DB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs2010-HelloWorld", "vs2010-HelloWorld.csproj", "{AC7C231F-0539-4612-A521-27CD9E00352B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5E1E5956-2AC0-4134-BA91-CE3A13268432}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E1E5956-2AC0-4134-BA91-CE3A13268432}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5E1E5956-2AC0-4134-BA91-CE3A13268432}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {5E1E5956-2AC0-4134-BA91-CE3A13268432}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {5E1E5956-2AC0-4134-BA91-CE3A13268432}.Debug|x86.ActiveCfg = Debug|Any CPU
{5E1E5956-2AC0-4134-BA91-CE3A13268432}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E1E5956-2AC0-4134-BA91-CE3A13268432}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5E1E5956-2AC0-4134-BA91-CE3A13268432}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {5E1E5956-2AC0-4134-BA91-CE3A13268432}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {5E1E5956-2AC0-4134-BA91-CE3A13268432}.Release|x86.ActiveCfg = Release|Any CPU
{E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Debug|x86.ActiveCfg = Debug|Any CPU
{E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {E7A4FA3E-6106-470C-99A6-B59C8340F7DB}.Release|x86.ActiveCfg = Release|Any CPU
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Debug|x86.ActiveCfg = Debug|x86
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Debug|x86.Build.0 = Debug|x86
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Release|Any CPU.ActiveCfg = Release|x86
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Release|Mixed Platforms.Build.0 = Release|x86
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Release|x86.ActiveCfg = Release|x86
+ {AC7C231F-0539-4612-A521-27CD9E00352B}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE