SPRNET-1310 - Update to use Apache NMS 1.3

This commit is contained in:
markpollack
2010-06-02 20:09:43 +00:00
parent eb4139219e
commit 65f1d2f4b8
22 changed files with 183 additions and 17 deletions

View File

@@ -780,6 +780,8 @@ Commandline Examples:
<delete dir="test/Spring/Spring.Services.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Nms.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Nms.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Nms.Integration.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Nms.Integeration.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Ems.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Ems.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Tests/obj" failonerror="false"/>
@@ -1614,6 +1616,7 @@ Commandline Examples:
<include name="test/Spring/Spring.Data.NHibernate21.Integration.Tests/**"/>
<include name="test/Spring/Spring.Messaging.Tests/**"/>
<include name="test/Spring/Spring.Messaging.Nms.Tests/**"/>
<include name="test/Spring/Spring.Messaging.Nms.Integration.Tests/**"/>
<include name="test/Spring/Spring.Messaging.Ems.Tests/**"/>
<include name="test/Spring/Spring.Scheduling.Quartz.Tests/**"/>
<include name="test/Spring/Spring.Template.Velocity.Tests/**"/>

View File

@@ -3,10 +3,15 @@
xmlns:nms="http://www.springframework.net/nms">
<object id="ConnectionFactory" type="Apache.NMS.ActiveMQ.ConnectionFactory, Apache.NMS.ActiveMQ">
<constructor-arg index="0" value="tcp://localhost:61616"/>
</object>
<object id="ConnectionFactory" type="Spring.Messaging.Nms.Connections.CachingConnectionFactory, Spring.Messaging.Nms">
<property name="SessionCacheSize" value="10" />
<property name="TargetConnectionFactory">
<object type="Apache.NMS.ActiveMQ.ConnectionFactory, Apache.NMS.ActiveMQ">
<constructor-arg index="0" value="tcp://localhost:61616"/>
</object>
</property>
</object>
<!-- NMS based implementation of technology neutral IStockServiceGateway -->
<object name="StockServiceGateway" type="Spring.NmsQuickStart.Client.Gateways.NmsStockServiceGateway, Spring.NmsQuickStart.Client">
<property name="NmsTemplate" ref="NmsTemplate"/>

View File

@@ -2,8 +2,13 @@
<objects xmlns="http://www.springframework.net"
xmlns:nms="http://www.springframework.net/nms">
<object id="ConnectionFactory" type="Apache.NMS.ActiveMQ.ConnectionFactory, Apache.NMS.ActiveMQ">
<constructor-arg index="0" value="tcp://localhost:61616"/>
<object id="ConnectionFactory" type="Spring.Messaging.Nms.Connections.CachingConnectionFactory, Spring.Messaging.Nms">
<property name="SessionCacheSize" value="10" />
<property name="TargetConnectionFactory">
<object type="Apache.NMS.ActiveMQ.ConnectionFactory, Apache.NMS.ActiveMQ">
<constructor-arg index="0" value="tcp://localhost:61616"/>
</object>
</property>
</object>
<object name="NmsTemplate" type="Spring.Messaging.Nms.Core.NmsTemplate, Spring.Messaging.Nms">

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -17,7 +17,7 @@
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = "rem $(ProjectDir)..\..\..\tools\antlr-2.7.6\antlr-2.7.6.exe -o $(ProjectDir)\Expressions\Parser $(ProjectDir)\Expressions\Expression.g"
PostBuildEvent = ""
PostBuildEvent = "rem"
RootNamespace = "Spring"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
@@ -34,7 +34,7 @@
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = "219, 162, 675,1591"
NoWarn = "219, 162, 675,1591,618"
Optimize = "false"
OutputPath = "..\..\..\build\VS.Net.2003\Spring.Core\Debug-1.1\"
RegisterForComInterop = "false"

View File

@@ -178,6 +178,15 @@ namespace Spring.Messaging.Nms.Connections
{
return target.CreateBytesMessage(body);
}
/// <summary>
/// Creates the stream message.
/// </summary>
/// <returns>A new stream message.</returns>
public IStreamMessage CreateStreamMessage()
{
return target.CreateStreamMessage();
}
#endregion
/// <summary>

View File

@@ -506,6 +506,16 @@ namespace Spring.Messaging.Nms.Connections
return target.CreateBytesMessage(body);
}
/// <summary>
/// Creates the stream message.
/// </summary>
/// <returns></returns>
public IStreamMessage CreateStreamMessage()
{
this.transactionOpen = true;
return target.CreateStreamMessage();
}
/// <summary>
/// Commits this instance.
/// </summary>
@@ -568,6 +578,29 @@ namespace Spring.Messaging.Nms.Connections
this.transactionOpen = true;
target.Dispose();
}
/// <summary>
/// Creates the queue browser with a specified selector
/// </summary>
/// <param name="queue">The queue.</param>
/// <param name="selector">The selector.</param>
/// <returns>The Queue browser</returns>
public IQueueBrowser CreateBrowser(IQueue queue, string selector)
{
this.transactionOpen = true;
return target.CreateBrowser(queue, selector);
}
/// <summary>
/// Creates the queue browser.
/// </summary>
/// <param name="queue">The queue.</param>
/// <returns>The Queue browser</returns>
public IQueueBrowser CreateBrowser(IQueue queue)
{
this.transactionOpen = true;
return target.CreateBrowser(queue);
}
#endregion
/// <summary>

View File

@@ -199,6 +199,25 @@ namespace Spring.Messaging.Nms.Connections
set { reconnectOnException = value; }
}
/// <summary>
/// Get/or set the broker Uri.
/// </summary>
public Uri BrokerUri
{
get { return targetConnectionFactory.BrokerUri; }
set { targetConnectionFactory.BrokerUri = value; }
}
/// <summary>
/// Get/or set the redelivery policy that new IConnection objects are
/// assigned upon creation.
/// </summary>
public IRedeliveryPolicy RedeliveryPolicy
{
get { return targetConnectionFactory.RedeliveryPolicy; }
set { targetConnectionFactory.RedeliveryPolicy = value; }
}
/// <summary>
/// Gets the connection monitor.
/// </summary>
@@ -511,6 +530,30 @@ namespace Spring.Messaging.Nms.Connections
}
}
public event ConnectionInterruptedListener ConnectionInterruptedListener
{
add
{
target.ConnectionInterruptedListener += value;
}
remove
{
target.ConnectionInterruptedListener -= value;
}
}
public event ConnectionResumedListener ConnectionResumedListener
{
add
{
target.ConnectionResumedListener += value;
}
remove
{
target.ConnectionResumedListener -= value;
}
}
public AcknowledgementMode AcknowledgementMode
{
@@ -528,6 +571,19 @@ namespace Spring.Messaging.Nms.Connections
{
get { return target.IsStarted; }
}
public IConnectionMetaData MetaData
{
get { return target.MetaData; }
}
public IRedeliveryPolicy RedeliveryPolicy
{
get { return target.RedeliveryPolicy; }
set { target.RedeliveryPolicy = value; }
}
#endregion
/// <summary>

View File

@@ -19,7 +19,7 @@
</object>
<object id="nmsTemplate" type="Spring.Messaging.Nms.Core.NmsTemplate, Spring.Messaging.Nms">
<property name="ConnectionFactory" ref="connectionFactory" />
<property name="ConnectionFactory" ref="nmsConnectionFactory" />
</object>
</objects>

View File

@@ -1,3 +1,14 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Apache.NMS" publicKeyToken="82756FEEE3957618" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.3.0.1959" newVersion="1.3.0.1959"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>

View File

@@ -30,7 +30,7 @@ using Rhino.Mocks;
namespace Spring.Messaging.Nms.Connections
{
/// <summary>
/// This class contains tests for
/// This class contains tests for CachingConnectionFactory
/// </summary>
/// <author>Mark Pollack</author>
[TestFixture]
@@ -242,8 +242,7 @@ namespace Spring.Messaging.Nms.Connections
IMessageConsumer consumerB = sessionB.CreateConsumer(destination);
TestMessageConsumer tmpB = GetTestMessageConsumer(consumerB);
Assert.AreSame(tmpA, tmpB);
Assert.AreSame(tmpA, tmpB);
mocks.VerifyAll();
}

View File

@@ -19,7 +19,14 @@ namespace Spring.Messaging.Nms.Connections
get { return closeCount; }
}
public IConnectionMetaData MetaData
{
get { throw new NotImplementedException(); }
}
public event ExceptionListener ExceptionListener;
public event ConnectionInterruptedListener ConnectionInterruptedListener;
public event ConnectionResumedListener ConnectionResumedListener;
public ISession CreateSession()
{
@@ -61,6 +68,12 @@ namespace Spring.Messaging.Nms.Connections
set { }
}
public IRedeliveryPolicy RedeliveryPolicy
{
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
public void Dispose()
{
}

View File

@@ -1,5 +1,6 @@
using System;
using Apache.NMS;
namespace Spring.Messaging.Nms.Connections
@@ -18,6 +19,18 @@ namespace Spring.Messaging.Nms.Connections
return new TestConnection();
}
public Uri BrokerUri
{
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
public IRedeliveryPolicy RedeliveryPolicy
{
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
#endregion
}
}

View File

@@ -90,6 +90,11 @@ namespace Spring.Messaging.Nms.Connections
throw new NotImplementedException();
}
public IStreamMessage CreateStreamMessage()
{
throw new NotImplementedException();
}
public MsgDeliveryMode DeliveryMode
{
get { return msgDeliveryMode; }

View File

@@ -21,14 +21,12 @@
using System;
using Apache.NMS;
using Apache.NMS.ActiveMQ.Commands;
using Rhino.Mocks;
namespace Spring.Messaging.Nms.Connections
{
public class TestSession : ISession
{
private MockRepository mocks = new MockRepository();
private int closeCount;
private int createdCount;
@@ -114,6 +112,16 @@ namespace Spring.Messaging.Nms.Connections
throw new NotImplementedException();
}
public IQueueBrowser CreateBrowser(IQueue queue)
{
throw new NotImplementedException();
}
public IQueueBrowser CreateBrowser(IQueue queue, string selector)
{
throw new NotImplementedException();
}
public void DeleteDurableConsumer(string name, TimeSpan requestTimeout)
{
throw new NotImplementedException();
@@ -183,6 +191,11 @@ namespace Spring.Messaging.Nms.Connections
throw new NotImplementedException();
}
public IStreamMessage CreateStreamMessage()
{
throw new NotImplementedException();
}
public void Close()
{
closeCount++;

View File

@@ -25,6 +25,7 @@ using System.Collections;
using System.Text;
using Apache.NMS;
using Apache.NMS.ActiveMQ.OpenWire;
using Apache.NMS.Util;
using NUnit.Framework;
using Rhino.Mocks;
using Spring.Messaging.Nms.Support.Converter;

View File

@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration>
<configSections>
<section name="NmsConfiguration" type="System.Configuration.NameValueSectionHandler"/>

View File

@@ -17,7 +17,7 @@
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = 'echo "Copying .xml files for Spring.Services tests"&#xd;&#xa;xcopy "$(ProjectDir)Data" ..\..\..\..\build\VS.Net.2003\Spring.Services.Tests\$(ConfigurationName)\ /y /s /q /d&#xd;&#xa;xcopy "$(ProjectDir)$(TargetFileName)-1.1.config" ..\..\..\..\build\VS.Net.2003\Spring.Services.Tests\$(ConfigurationName)\$(TargetFileName).config'
PostBuildEvent = 'echo "Copying .xml files for Spring.Services tests"&#xd;&#xa;xcopy /f /y /s /d /i "$(ProjectDir)Data" ..\..\..\..\build\VS.NET.2003\Spring.Services.Tests\$(ConfigurationName)\ &#xd;&#xa;rem xcopy "$(ProjectDir)$(TargetFileName)-1.1.config" ..\..\..\..\build\VS.NET.2003\Spring.Services.Tests\$(ConfigurationName)\$(TargetFileName).config /s /q&#xd;&#xa;copy /y "$(ProjectDir)$(TargetFileName)-1.1.config" ..\..\..\..\build\VS.Net.2003\Spring.Services.Tests\$(ConfigurationName)\$(TargetFileName).config '
RootNamespace = "Spring"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""

View File

@@ -316,7 +316,7 @@
/>
<File
RelPath = "Web\Support\ControlInterceptionTests.cs"
SubType = "ASPXCodeBehind"
SubType = "Code"
BuildAction = "Compile"
/>
<File