diff options
Diffstat (limited to 'dotnet/client-010/examples/direct/example-direct-producer')
4 files changed, 0 insertions, 279 deletions
diff --git a/dotnet/client-010/examples/direct/example-direct-producer/Producer.cs b/dotnet/client-010/examples/direct/example-direct-producer/Producer.cs deleted file mode 100644 index f62667bf98..0000000000 --- a/dotnet/client-010/examples/direct/example-direct-producer/Producer.cs +++ /dev/null @@ -1,92 +0,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. -*/ - -using System; -using System.Configuration; -using System.Text; -using org.apache.qpid.client; - -namespace org.apache.qpid.example.direct -{ - /// <summary> - /// This program is one of three programs designed to be used - /// together. These programs use the "amq.direct" exchange. - /// - /// Producer (this program): - /// - /// Publishes to a broker, specifying a routing key. - /// - /// Listener: - /// - /// Reads from a queue on the broker using a message listener. - /// - /// </summary> - class Producer - { - static void Main(string[] args) - { - string host = ConfigurationManager.AppSettings["Host"]; - int port = int.Parse(ConfigurationManager.AppSettings["Port"]); - string virtualhost = ConfigurationManager.AppSettings["VirtualHost"]; - string username = ConfigurationManager.AppSettings["Username"]; - string password = ConfigurationManager.AppSettings["Password"]; - - Client connection = new Client(); - try - { - connection.Connect(host, port, virtualhost, username, password); - IClientSession session = connection.CreateSession(50000); - - //--------- Main body of program -------------------------------------------- - - IMessage message = new Message(); - - // The routing key is a message property. We will use the same - // routing key for each message, so we'll set this property - // just once. (In most simple cases, there is no need to set - // other message properties.) - - message.DeliveryProperties.SetRoutingKey("routing_key"); - - // Asynchronous transfer sends messages as quickly as - // possible without waiting for confirmation. - for (int i = 0; i < 10; i++) - { - message.ClearData(); - message.AppendData(Encoding.UTF8.GetBytes("Message " + i)); - session.MessageTransfer("amq.direct", message); - } - - // And send a syncrhonous final message to indicate termination. - message.ClearData(); - message.AppendData(Encoding.UTF8.GetBytes("That's all, folks!")); - session.MessageTransfer("amq.direct", "routing_key", message); - session.Sync(); - - //----------------------------------------------------------------------------- - - connection.Close(); - } - catch (Exception e) - { - Console.WriteLine("Error: \n" + e.StackTrace); - } - } - } -} diff --git a/dotnet/client-010/examples/direct/example-direct-producer/Properties/AssemblyInfo.cs b/dotnet/client-010/examples/direct/example-direct-producer/Properties/AssemblyInfo.cs deleted file mode 100644 index 84590e67c1..0000000000 --- a/dotnet/client-010/examples/direct/example-direct-producer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,54 +0,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. - * - */ - -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("example-direct-producer")] -[assembly: AssemblyDescription("Built from svn revision number: ")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Apache Software Foundation")] -[assembly: AssemblyProduct("example-direct-producer")] -[assembly: AssemblyCopyright("Apache Software Foundation")] -[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("006144c2-5e45-4543-8e16-c09cd4309ed7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("0.5.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/dotnet/client-010/examples/direct/example-direct-producer/default.build b/dotnet/client-010/examples/direct/example-direct-producer/default.build deleted file mode 100644 index c4e78444c7..0000000000 --- a/dotnet/client-010/examples/direct/example-direct-producer/default.build +++ /dev/null @@ -1,48 +0,0 @@ -<?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. - ---> - -<project name="example-direct-Producer" default="build"> - <!-- - Properties that come from master build file - - build.dir: root directory for build - - build.debug: true if building debug release - - build.defines: variables to define during build - --> - - <target name="build"> - <csc target="exe" - define="${build.defines}" - debug="${build.debug}" - output="${build.dir}/${project::get-name()}.exe"> - - <sources> - <include name="**/*.cs" /> - </sources> - <references> - <include name="${build.dir}/log4net.dll" /> - <include name="${build.dir}/qpid.client.dll" /> - <include name="System.Configuration.dll" /> - </references> - </csc> - </target> -</project> - diff --git a/dotnet/client-010/examples/direct/example-direct-producer/example-direct-producer.csproj b/dotnet/client-010/examples/direct/example-direct-producer/example-direct-producer.csproj deleted file mode 100644 index 10d9d96aea..0000000000 --- a/dotnet/client-010/examples/direct/example-direct-producer/example-direct-producer.csproj +++ /dev/null @@ -1,85 +0,0 @@ -<?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 DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{96FCB250-8142-40EE-9BDD-CA839EE21021}</ProjectGuid> - <OutputType>Exe</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>example_direct_producer</RootNamespace> - <AssemblyName>example-direct-producer</AssemblyName> - <FileUpgradeFlags> - </FileUpgradeFlags> - <OldToolsVersion>2.0</OldToolsVersion> - <UpgradeBackupLocation> - </UpgradeBackupLocation> - </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="System" /> - <Reference Include="System.configuration" /> - <Reference Include="System.Data" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Producer.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\..\client\Client.csproj"> - <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project> - <Name>Client</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <None Include="..\..\..\App.config"> - <Link>App.config</Link> - </None> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\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> |