Skip to content
Permalink
Browse files
AMQNET-589: Failover implementation
  • Loading branch information
Havret committed Jul 16, 2019
1 parent 3b8f72c commit e9d8fd2264d22a6531fe757e7f6f0fa68190cd71
Showing 222 changed files with 22,839 additions and 11,890 deletions.
@@ -259,3 +259,4 @@ ModelManifest.xml

# FAKE - F# Make
.fake/
.idea/
@@ -1,12 +1,12 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.10
# Visual Studio Version 16
VisualStudioVersion = 16.0.28922.388
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Apache-NMS-AMQP", "src\NMS.AMQP\Apache-NMS-AMQP.csproj", "{0D8CF699-9702-4EC6-8719-C2968D32F09A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorld", "src\HelloWorld\HelloWorld.csproj", "{A56349BE-ED66-4E18-B5FE-E3EA069D2ADD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Apache-NMS-AMQP-Test", "test\Apache-NMS-AMQP-Test.csproj", "{DF402917-D85D-421C-A7E2-DC3DF371B9CB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Apache-NMS-AMQP-Test", "test\Apache-NMS-AMQP-Test\Apache-NMS-AMQP-Test.csproj", "{DF402917-D85D-421C-A7E2-DC3DF371B9CB}"
ProjectSection(ProjectDependencies) = postProject
{0D8CF699-9702-4EC6-8719-C2968D32F09A} = {0D8CF699-9702-4EC6-8719-C2968D32F09A}
EndProjectSection
@@ -17,6 +17,7 @@
using System;
using System.Collections.Specialized;
using Apache.NMS;
using Apache.NMS.AMQP;
using CommandLine;

namespace HelloWorld
@@ -65,20 +66,6 @@ private static void RunWithOptions (CommandLineOpts opts)
Uri providerUri = new Uri(ip);
Console.WriteLine("scheme: {0}", providerUri.Scheme);

StringDictionary properties = new StringDictionary();
if (opts.username != null)
{
properties["NMS.username"] = opts.username;
}
if (opts.password != null)
{
properties["NMS.password"] = opts.password;
}
if (opts.clientId != null)
{
properties["NMS.clientId"] = opts.clientId;
}
properties["NMS.sendtimeout"] = opts.connTimeout+"";
IConnection conn = null;
if (opts.topic == null && opts.queue == null)
{
@@ -87,8 +74,24 @@ private static void RunWithOptions (CommandLineOpts opts)
}
try
{
Apache.NMS.AMQP.NMSConnectionFactory providerFactory = new Apache.NMS.AMQP.NMSConnectionFactory(providerUri, properties);
IConnectionFactory factory = providerFactory.ConnectionFactory;
NmsConnectionFactory factory = new NmsConnectionFactory(ip);
if (opts.username != null)
{
factory.UserName = opts.username;
}
if (opts.password != null)
{
factory.Password = opts.password;
}
if (opts.clientId != null)
{
factory.ClientId = opts.clientId;
}

if (opts.connTimeout != default)
{
factory.SendTimeout = opts.connTimeout;
}

Console.WriteLine("Creating Connection...");
conn = factory.CreateConnection();
@@ -21,6 +21,7 @@ under the License.
<OutputType>Exe</OutputType>
<RootNamespace>HelloWorld</RootNamespace>
<AssemblyName>HelloWorld</AssemblyName>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<ItemGroup>
@@ -22,6 +22,7 @@ with the License. You may obtain a copy of the License at
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<RootNamespace>Apache.NMS.AMQP</RootNamespace>
<AssemblyName>Apache.NMS.AMQP</AssemblyName>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<PropertyGroup>
@@ -63,5 +64,6 @@ with the License. You may obtain a copy of the License at
<!-- AMQPNetLite.Core is .NET Standard 1.3 package -->
<PackageReference Include="AMQPNetLite.Core" Version="2.1.7" />
<PackageReference Include="Apache.NMS" Version="1.8.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.9.0" />
</ItemGroup>
</Project>

0 comments on commit e9d8fd2

Please sign in to comment.