Author: jgomes
Date: Tue Aug 19 15:07:32 2008
New Revision: 687180
URL: http://svn.apache.org/viewvc?rev=687180&view=rev
Log:
Changed IConnection, ISession to have RequestTimeout property similar to
IMessageProducer.
Fixes [AMQNET-89]. (See https://issues.apache.org/activemq/browse/AMQNET-89)
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Tcp/TcpTransportFactory.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
Tue Aug 19 15:07:32 2008
@@ -32,6 +32,7 @@
private ITransport transport;
private readonly ConnectionInfo info;
private AcknowledgementMode acknowledgementMode =
AcknowledgementMode.AutoAcknowledge;
+ private TimeSpan requestTimeout;
private BrokerInfo brokerInfo; // from broker
private WireFormatInfo brokerWireFormatInfo; // from broker
private readonly IList sessions = ArrayList.Synchronized(new
ArrayList());
@@ -50,6 +51,7 @@
{
this.brokerUri = connectionUri;
this.info = info;
+ this.requestTimeout = transport.RequestTimeout;
this.transport = transport;
this.transport.Command = new CommandHandler(OnCommand);
this.transport.Exception = new
ExceptionHandler(OnException);
@@ -152,16 +154,8 @@
/// </summary>
public ISession CreateSession(AcknowledgementMode
sessionAcknowledgementMode)
{
- return CreateSession(sessionAcknowledgementMode,
transport.RequestTimeout);
- }
-
- /// <summary>
- /// Creates a new session to work on this connection
- /// </summary>
- public ISession CreateSession(AcknowledgementMode
sessionAcknowledgementMode, TimeSpan requestTimeout)
- {
SessionInfo info =
CreateSessionInfo(sessionAcknowledgementMode);
- SyncRequest(info, requestTimeout);
+ SyncRequest(info, this.RequestTimeout);
Session session = new Session(this, info,
sessionAcknowledgementMode);
// Set properties on session using parameters prefixed
with "session."
@@ -266,6 +260,12 @@
set { this.transport = value; }
}
+ public TimeSpan RequestTimeout
+ {
+ get { return this.requestTimeout; }
+ set { this.requestTimeout = value; }
+ }
+
public AcknowledgementMode AcknowledgementMode
{
get { return acknowledgementMode; }
@@ -309,7 +309,7 @@
public Response SyncRequest(Command command)
{
- return SyncRequest(command, transport.RequestTimeout);
+ return SyncRequest(command, this.RequestTimeout);
}
public Response SyncRequest(Command command, TimeSpan
requestTimeout)
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageProducer.cs
Tue Aug 19 15:07:32 2008
@@ -32,9 +32,8 @@
private long messageCounter = 0;
private bool msgPersistent = NMSConstants.defaultPersistence;
- private TimeSpan msgTimeToLive;
- private TimeSpan requestTimeout =
TimeSpan.FromMilliseconds(Timeout.Infinite);
- private bool specifiedRequestTimeout = false;
+ private TimeSpan requestTimeout;
+ private TimeSpan msgTimeToLive = NMSConstants.defaultTimeToLive;
private readonly bool defaultSpecifiedTimeToLive = false;
private byte msgPriority = NMSConstants.defaultPriority;
private bool disableMessageID = false;
@@ -45,6 +44,7 @@
{
this.session = session;
this.info = info;
+ this.RequestTimeout = session.RequestTimeout;
}
~MessageProducer()
@@ -174,18 +174,7 @@
activeMessage.NMSTimeToLive = timeToLive;
}
- TimeSpan timeout;
-
- if(specifiedRequestTimeout)
- {
- timeout = this.requestTimeout;
- }
- else
- {
- timeout =
session.Connection.ITransport.RequestTimeout;
- }
-
- session.DoSend(activeMessage, timeout);
+ session.DoSend(activeMessage, this.RequestTimeout);
}
public bool Persistent
@@ -203,7 +192,7 @@
public TimeSpan RequestTimeout
{
get { return requestTimeout; }
- set { this.requestTimeout = value;
specifiedRequestTimeout = true; }
+ set { this.requestTimeout = value; }
}
public byte Priority
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs
Tue Aug 19 15:07:32 2008
@@ -42,6 +42,7 @@
this.info = info;
this.AcknowledgementMode = acknowledgementMode;
this.AsyncSend = connection.AsyncSend;
+ this.RequestTimeout = connection.RequestTimeout;
this.PrefetchSize = 1000;
this.TransactionContext = new TransactionContext(this);
this.dispatchingThread = new DispatchingThread(new
DispatchingThread.DispatchFunction(DispatchAsyncMessages));
@@ -181,16 +182,11 @@
public IMessageProducer CreateProducer()
{
- return CreateProducer(null,
Connection.ITransport.RequestTimeout);
+ return CreateProducer(null);
}
public IMessageProducer CreateProducer(IDestination destination)
{
- return CreateProducer(destination,
Connection.ITransport.RequestTimeout);
- }
-
- public IMessageProducer CreateProducer(IDestination
destination, TimeSpan requestTimeout)
- {
ProducerInfo command = CreateProducerInfo(destination);
ProducerId producerId = command.ProducerId;
MessageProducer producer = null;
@@ -198,8 +194,8 @@
try
{
producer = new MessageProducer(this, command);
- Connection.SyncRequest(command, requestTimeout);
producers[producerId] = producer;
+ this.DoSend(command);
}
catch(Exception)
{
@@ -216,31 +212,16 @@
public IMessageConsumer CreateConsumer(IDestination destination)
{
- return CreateConsumer(destination, null, false,
Connection.ITransport.RequestTimeout);
- }
-
- public IMessageConsumer CreateConsumer(IDestination
destination, TimeSpan requestTimeout)
- {
- return CreateConsumer(destination, null, false,
requestTimeout);
+ return CreateConsumer(destination, null, false);
}
public IMessageConsumer CreateConsumer(IDestination
destination, string selector)
{
- return CreateConsumer(destination, selector, false,
Connection.ITransport.RequestTimeout);
- }
-
- public IMessageConsumer CreateConsumer(IDestination
destination, string selector, TimeSpan requestTimeout)
- {
- return CreateConsumer(destination, selector, false,
requestTimeout);
+ return CreateConsumer(destination, selector, false);
}
public IMessageConsumer CreateConsumer(IDestination
destination, string selector, bool noLocal)
{
- return CreateConsumer(destination, selector, noLocal,
Connection.ITransport.RequestTimeout);
- }
-
- public IMessageConsumer CreateConsumer(IDestination
destination, string selector, bool noLocal, TimeSpan requestTimeout)
- {
ConsumerInfo command = CreateConsumerInfo(destination,
selector);
command.NoLocal = noLocal;
command.AcknowledgementMode = this.AcknowledgementMode;
@@ -253,7 +234,7 @@
consumer = new MessageConsumer(this, command,
this.AcknowledgementMode);
// lets register the consumer first in case we
start dispatching messages immediately
consumers[consumerId] = consumer;
- Connection.SyncRequest(command, requestTimeout);
+ this.DoSend(command);
return consumer;
}
catch(Exception)
@@ -269,11 +250,6 @@
public IMessageConsumer CreateDurableConsumer(ITopic
destination, string name, string selector, bool noLocal)
{
- return CreateDurableConsumer(destination, name,
selector, noLocal, Connection.ITransport.RequestTimeout);
- }
-
- public IMessageConsumer CreateDurableConsumer(ITopic
destination, string name, string selector, bool noLocal, TimeSpan
requestTimeout)
- {
ConsumerInfo command = CreateConsumerInfo(destination,
selector);
ConsumerId consumerId = command.ConsumerId;
command.SubscriptionName = name;
@@ -285,7 +261,7 @@
consumer = new MessageConsumer(this, command,
this.AcknowledgementMode);
// lets register the consumer first in case we
start dispatching messages immediately
consumers[consumerId] = consumer;
- Connection.SyncRequest(command, requestTimeout);
+ this.DoSend(command);
}
catch(Exception)
{
@@ -302,17 +278,12 @@
public void DeleteDurableConsumer(string name)
{
- DeleteDurableConsumer(name,
Connection.ITransport.RequestTimeout);
- }
-
- public void DeleteDurableConsumer(string name, TimeSpan
requestTimeout)
- {
RemoveSubscriptionInfo command = new
RemoveSubscriptionInfo();
command.ConnectionId = Connection.ConnectionId;
command.ClientId = Connection.ClientId;
command.SubcriptionName = name;
- Connection.SyncRequest(command, requestTimeout);
+ this.DoSend(command);
}
public IQueue GetQueue(string name)
@@ -417,11 +388,11 @@
// Properties
- private AcknowledgementMode acknowledgementMode;
- public AcknowledgementMode AcknowledgementMode
+ private TimeSpan requestTimeout;
+ public TimeSpan RequestTimeout
{
- get { return this.acknowledgementMode; }
- private set { this.acknowledgementMode = value; }
+ get { return this.requestTimeout; }
+ set { this.requestTimeout = value; }
}
public bool Transacted
@@ -429,6 +400,13 @@
get { return this.AcknowledgementMode ==
AcknowledgementMode.Transactional; }
}
+ private AcknowledgementMode acknowledgementMode;
+ public AcknowledgementMode AcknowledgementMode
+ {
+ get { return this.acknowledgementMode; }
+ private set { this.acknowledgementMode = value; }
+ }
+
#endregion
private void dispatchingThread_ExceptionListener(Exception
exception)
@@ -443,7 +421,7 @@
command.OperationType = 0; // 0 is add
command.Destination = tempDestination;
- Connection.SyncRequest(command);
+ this.DoSend(command);
}
protected void DestroyTemporaryDestination(ActiveMQDestination
tempDestination)
@@ -453,10 +431,15 @@
command.OperationType = 1; // 1 is remove
command.Destination = tempDestination;
- Connection.SyncRequest(command);
+ this.DoSend(command);
+ }
+
+ public void DoSend(Command message)
+ {
+ this.DoSend(message, this.RequestTimeout);
}
- public void DoSend(ActiveMQMessage message, TimeSpan
requestTimeout)
+ public void DoSend(Command message, TimeSpan requestTimeout)
{
if(AsyncSend)
{
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Tcp/TcpTransportFactory.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Tcp/TcpTransportFactory.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Tcp/TcpTransportFactory.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Tcp/TcpTransportFactory.cs
Tue Aug 19 15:07:32 2008
@@ -49,7 +49,7 @@
set { wireFormat = value; }
}
- private TimeSpan requestTimeout =
TimeSpan.FromMilliseconds(Timeout.Infinite);
+ private TimeSpan requestTimeout =
NMSConstants.defaultRequestTimeout;
public int RequestTimeout
{
get { return (int) requestTimeout.TotalMilliseconds; }
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IConnection.cs
Tue Aug 19 15:07:32 2008
@@ -76,29 +76,33 @@
ISession CreateSession(AcknowledgementMode acknowledgementMode);
/// <summary>
- /// Creates a new session to work on this connection
+ /// Closes the connection.
/// </summary>
- ISession CreateSession(AcknowledgementMode acknowledgementMode,
TimeSpan requestTimeout);
+ void Close();
/// <summary>
- /// The default acknowledgement mode
+ /// An asynchronous listener which can be notified if an error
occurs
/// </summary>
- AcknowledgementMode AcknowledgementMode { get; set; }
+ event ExceptionListener ExceptionListener;
+
+ #region Attributes
/// <summary>
- /// Sets the unique clienet ID for this connection before
Start() or returns the
- /// unique client ID after the connection has started
+ /// The default timeout for network requests.
/// </summary>
- string ClientId { get; set; }
+ TimeSpan RequestTimeout { get; set; }
/// <summary>
- /// An asynchronous listener which can be notified if an error
occurs
+ /// The default acknowledgement mode
/// </summary>
- event ExceptionListener ExceptionListener;
+ AcknowledgementMode AcknowledgementMode { get; set; }
/// <summary>
- /// Closes the connection.
+ /// Sets the unique clienet ID for this connection before
Start() or returns the
+ /// unique client ID after the connection has started
/// </summary>
- void Close();
+ string ClientId { get; set; }
+
+ #endregion
}
}
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/ISession.cs Tue
Aug 19 15:07:32 2008
@@ -35,21 +35,11 @@
IMessageProducer CreateProducer(IDestination destination);
/// <summary>
- /// Creates a producer of messages on a given destination
- /// </summary>
- IMessageProducer CreateProducer(IDestination destination,
TimeSpan requestTimeout);
-
- /// <summary>
/// Creates a consumer of messages on a given destination
/// </summary>
IMessageConsumer CreateConsumer(IDestination destination);
/// <summary>
- /// Creates a consumer of messages on a given destination
- /// </summary>
- IMessageConsumer CreateConsumer(IDestination destination,
TimeSpan requestTimeout);
-
- /// <summary>
/// Creates a consumer of messages on a given destination with
a selector
/// </summary>
IMessageConsumer CreateConsumer(IDestination destination,
string selector);
@@ -57,42 +47,20 @@
/// <summary>
/// Creates a consumer of messages on a given destination with
a selector
/// </summary>
- IMessageConsumer CreateConsumer(IDestination destination,
string selector, TimeSpan requestTimeout);
-
- /// <summary>
- /// Creates a consumer of messages on a given destination with
a selector
- /// </summary>
IMessageConsumer CreateConsumer(IDestination destination,
string selector, bool noLocal);
/// <summary>
- /// Creates a consumer of messages on a given destination with
a selector
- /// </summary>
- IMessageConsumer CreateConsumer(IDestination destination,
string selector, bool noLocal, TimeSpan requestTimeout);
-
- /// <summary>
/// Creates a named durable consumer of messages on a given
destination with a selector
/// </summary>
IMessageConsumer CreateDurableConsumer(ITopic destination,
string name, string selector, bool noLocal);
/// <summary>
- /// Creates a named durable consumer of messages on a given
destination with a selector
- /// </summary>
- IMessageConsumer CreateDurableConsumer(ITopic destination,
string name, string selector, bool noLocal, TimeSpan requestTimeout);
-
- /// <summary>
/// Deletes a durable consumer created with
CreateDurableConsumer().
/// </summary>
/// <param name="name">Name of the durable consumer</param>
void DeleteDurableConsumer(string name);
/// <summary>
- /// Deletes a durable consumer created with
CreateDurableConsumer().
- /// </summary>
- /// <param name="name">Name of the durable consumer</param>
- /// <param name="requestTimeout">Timeout to wait for response
from broker.</param>
- void DeleteDurableConsumer(string name, TimeSpan
requestTimeout);
-
- /// <summary>
/// Returns the queue for the given name
/// </summary>
IQueue GetQueue(string name);
@@ -172,7 +140,9 @@
#endregion
#region Attributes
-
+
+ TimeSpan RequestTimeout { get; set; }
+
bool Transacted { get; }
AcknowledgementMode AcknowledgementMode { get; }
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs
Tue Aug 19 15:07:32 2008
@@ -15,6 +15,7 @@
* limitations under the License.
*/
using System;
+using System.Threading;
namespace Apache.NMS
{
@@ -26,6 +27,7 @@
public const byte defaultPriority = 5;
public const bool defaultPersistence = true;
public static readonly TimeSpan defaultTimeToLive =
TimeSpan.Zero;
+ public static readonly TimeSpan defaultRequestTimeout =
TimeSpan.FromMilliseconds(Timeout.Infinite);
}
}
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs
Tue Aug 19 15:07:32 2008
@@ -66,8 +66,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent =
persistent;
producer.RequestTimeout =
receiveTimeout;
@@ -105,7 +105,7 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent = false;
producer.RequestTimeout =
receiveTimeout;
@@ -115,7 +115,7 @@
request.NMSType = "Test";
producer.Send(request);
- using(IMessageConsumer consumer
= session.CreateConsumer(destination, receiveTimeout))
+ using(IMessageConsumer consumer
= session.CreateConsumer(destination))
{
consumer.Listener +=
new MessageListener(OnMessage);
WaitForMessageToArrive();
@@ -146,8 +146,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent =
persistent;
producer.RequestTimeout =
receiveTimeout;
@@ -186,10 +186,10 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
{
consumer.Listener += new
MessageListener(OnMessage);
- using(IMessageProducer producer
= session.CreateProducer(destination, receiveTimeout))
+ using(IMessageProducer producer
= session.CreateProducer(destination))
{
producer.Persistent =
persistent;
producer.RequestTimeout
= receiveTimeout;
@@ -234,9 +234,9 @@
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
ITemporaryQueue tempReplyDestination =
session.CreateTemporaryQueue();
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageConsumer tempConsumer =
session.CreateConsumer(tempReplyDestination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageConsumer tempConsumer =
session.CreateConsumer(tempReplyDestination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent =
persistent;
producer.RequestTimeout =
receiveTimeout;
@@ -264,7 +264,7 @@
connection.Start();
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
- using(IMessageProducer producer =
session.CreateProducer(message.NMSReplyTo, receiveTimeout))
+ using(IMessageProducer producer =
session.CreateProducer(message.NMSReplyTo))
{
producer.Persistent =
message.NMSPersistent;
producer.RequestTimeout =
receiveTimeout;
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs
Tue Aug 19 15:07:32 2008
@@ -47,8 +47,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent =
persistent;
producer.RequestTimeout =
receiveTimeout;
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs
Tue Aug 19 15:07:32 2008
@@ -37,7 +37,7 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.DupsOkAcknowledge))
{
ITopic topic =
SessionUtil.GetTopic(session, TOPIC);
- using(IMessageProducer producer =
session.CreateProducer(topic, receiveTimeout))
+ using(IMessageProducer producer =
session.CreateProducer(topic))
{
ITextMessage message =
session.CreateTextMessage("Persistent Hello");
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs
Tue Aug 19 15:07:32 2008
@@ -63,8 +63,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent =
persistent;
producer.RequestTimeout =
receiveTimeout;
@@ -147,8 +147,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent =
persistent;
producer.RequestTimeout =
receiveTimeout;
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs
Tue Aug 19 15:07:32 2008
@@ -62,8 +62,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent =
persistent;
producer.RequestTimeout =
receiveTimeout;
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs
Tue Aug 19 15:07:32 2008
@@ -55,8 +55,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Priority = priority;
producer.Persistent =
persistent;
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSTestSupport.cs
Tue Aug 19 15:07:32 2008
@@ -199,6 +199,7 @@
{
IConnection newConnection =
Factory.CreateConnection(userName, passWord);
Assert.IsNotNull(newConnection, "connection not
created");
+ newConnection.RequestTimeout = this.receiveTimeout;
if(newClientId != null)
{
newConnection.ClientId = newClientId;
@@ -224,7 +225,7 @@
{
ITopic destinationTopic =
SessionUtil.GetTopic(session, destination);
Assert.IsNotNull(destinationTopic,
"Could not get destination topic.");
- using(IMessageConsumer consumer =
session.CreateDurableConsumer(destinationTopic, consumerID, selector, noLocal,
receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateDurableConsumer(destinationTopic, consumerID, selector, noLocal))
{
}
}
@@ -243,7 +244,7 @@
connection.Start();
using(ISession session =
connection.CreateSession(AcknowledgementMode.DupsOkAcknowledge))
{
-
session.DeleteDurableConsumer(consumerID, receiveTimeout);
+
session.DeleteDurableConsumer(consumerID);
}
}
}
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs
Tue Aug 19 15:07:32 2008
@@ -47,8 +47,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent =
persistent;
producer.RequestTimeout =
receiveTimeout;
Modified:
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs?rev=687180&r1=687179&r2=687180&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs
Tue Aug 19 15:07:32 2008
@@ -38,8 +38,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.Transactional))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent = false;
producer.RequestTimeout =
receiveTimeout;
@@ -82,7 +82,7 @@
using(ISession session1 =
connection1.CreateSession(AcknowledgementMode.Transactional))
{
IDestination destination1 =
SessionUtil.GetDestination(session1, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session1.CreateConsumer(destination1, receiveTimeout))
+ using(IMessageConsumer consumer =
session1.CreateConsumer(destination1))
{
// First connection session
that sends one message, and the
// second message is implicitly
rolled back as the session is
@@ -93,7 +93,7 @@
using(ISession session2
= connection2.CreateSession(AcknowledgementMode.Transactional))
{
IDestination
destination2 = SessionUtil.GetDestination(session2, DESTINATION_NAME);
-
using(IMessageProducer producer = session2.CreateProducer(destination2,
receiveTimeout))
+
using(IMessageProducer producer = session2.CreateProducer(destination2))
{
producer.Persistent = false;
producer.RequestTimeout = receiveTimeout;
@@ -114,7 +114,7 @@
using(ISession session2
= connection2.CreateSession(AcknowledgementMode.Transactional))
{
IDestination
destination2 = SessionUtil.GetDestination(session2, DESTINATION_NAME);
-
using(IMessageProducer producer = session2.CreateProducer(destination2,
receiveTimeout))
+
using(IMessageProducer producer = session2.CreateProducer(destination2))
{
producer.Persistent = false;
producer.RequestTimeout = receiveTimeout;
@@ -148,8 +148,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.Transactional))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent = false;
producer.RequestTimeout =
receiveTimeout;
@@ -189,8 +189,8 @@
using(ISession session =
connection.CreateSession(AcknowledgementMode.Transactional))
{
IDestination destination =
SessionUtil.GetDestination(session, DESTINATION_NAME);
- using(IMessageConsumer consumer =
session.CreateConsumer(destination, receiveTimeout))
- using(IMessageProducer producer =
session.CreateProducer(destination, receiveTimeout))
+ using(IMessageConsumer consumer =
session.CreateConsumer(destination))
+ using(IMessageProducer producer =
session.CreateProducer(destination))
{
producer.Persistent = false;
producer.RequestTimeout =
receiveTimeout;