Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 20515 invoked from network); 18 Oct 2006 12:33:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Oct 2006 12:33:21 -0000 Received: (qmail 79883 invoked by uid 500); 18 Oct 2006 12:33:21 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 79869 invoked by uid 500); 18 Oct 2006 12:33:20 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 79860 invoked by uid 99); 18 Oct 2006 12:33:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Oct 2006 05:33:20 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Oct 2006 05:33:19 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 694231A981A; Wed, 18 Oct 2006 05:32:59 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r465235 - in /incubator/activemq/activemq-dotnet/trunk/src/main/csharp: ActiveMQ/MessageConsumer.cs ActiveMQ/Session.cs NMS/ISession.cs Date: Wed, 18 Oct 2006 12:32:59 -0000 To: activemq-commits@geronimo.apache.org From: jstrachan@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061018123259.694231A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jstrachan Date: Wed Oct 18 05:32:58 2006 New Revision: 465235 URL: http://svn.apache.org/viewvc?view=rev&rev=465235 Log: added a bunch of default properties onto ISession to allow consumers to be configured such as retroactive or exclusive consumers etc Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs?view=diff&rev=465235&r1=465234&r2=465235 ============================================================================== --- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs (original) +++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs Wed Oct 18 05:32:58 2006 @@ -81,6 +81,7 @@ get { return redeliveryTimeout; } set { redeliveryTimeout = value; } } + public void RedeliverRolledBackMessages() { Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs?view=diff&rev=465235&r1=465234&r2=465235 ============================================================================== --- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs (original) +++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs Wed Oct 18 05:32:58 2006 @@ -32,6 +32,11 @@ private long consumerCounter; private long producerCounter; private int prefetchSize = 1000; + private int maximumPendingMessageLimit; + private byte priority; + private bool dispatchAsync; + private bool exclusive; + private bool retroactive; private IDictionary consumers = Hashtable.Synchronized(new Hashtable()); private TransactionContext transactionContext; @@ -43,6 +48,41 @@ transactionContext = new TransactionContext(this); } + public int PrefetchSize + { + get { return prefetchSize; } + set { this.prefetchSize = value; } + } + + public int MaximumPendingMessageLimit + { + get { return maximumPendingMessageLimit; } + set { this.maximumPendingMessageLimit = value; } + } + + public bool DispatchAsync + { + get { return dispatchAsync; } + set { this.dispatchAsync = value; } + } + + public bool Exclusive + { + get { return exclusive; } + set { this.exclusive = value; } + } + + public bool Retroactive + { + get { return retroactive; } + set { this.retroactive = value; } + } + + public byte Priority + { + get { return priority; } + set { this.priority = value; } + } public void Dispose() { @@ -316,6 +356,10 @@ answer.Destination = ActiveMQDestination.Transform(destination); answer.Selector = selector; answer.PrefetchSize = prefetchSize; + answer.Priority = priority; + answer.Exclusive = exclusive; + answer.DispatchAsync = dispatchAsync; + answer.Retroactive = retroactive; // If the destination contained a URI query, then use it to set public properties // on the ConsumerInfo Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs?view=diff&rev=465235&r1=465234&r2=465235 ============================================================================== --- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs (original) +++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs Wed Oct 18 05:32:58 2006 @@ -14,110 +14,136 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -namespace NMS -{ - /// - /// Represents a single unit of work on an IConnection. - /// So the ISession can be used to perform transactional receive and sends - /// - public interface ISession : System.IDisposable - { - +namespace NMS { /// - /// Creates a producer of messages + /// Represents a single unit of work on an IConnection. + /// So the ISession can be used to perform transactional receive and sends /// - IMessageProducer CreateProducer(); - - /// - /// Creates a producer of messages on a given destination - /// - IMessageProducer CreateProducer(IDestination destination); - - /// - /// Creates a consumer of messages on a given destination - /// - IMessageConsumer CreateConsumer(IDestination destination); - - /// - /// Creates a consumer of messages on a given destination with a selector - /// - IMessageConsumer CreateConsumer(IDestination destination, string selector); - - /// - /// Creates a named durable consumer of messages on a given destination with a selector - /// - IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal); - - /// - /// Returns the queue for the given name - /// - IQueue GetQueue(string name); - - /// - /// Returns the topic for the given name - /// - ITopic GetTopic(string name); - - - /// - /// Creates a temporary queue - /// - ITemporaryQueue CreateTemporaryQueue(); - - /// - /// Creates a temporary topic - /// - ITemporaryTopic CreateTemporaryTopic(); - - - // Factory methods to create messages - - /// - /// Creates a new message with an empty body - /// - IMessage CreateMessage(); - - /// - /// Creates a new text message with an empty body - /// - ITextMessage CreateTextMessage(); - - /// - /// Creates a new text message with the given body - /// - ITextMessage CreateTextMessage(string text); - - /// - /// Creates a new Map message which contains primitive key and value pairs - /// - IMapMessage CreateMapMessage(); - - /// - /// Creates a new binary message - /// - IBytesMessage CreateBytesMessage(); - - /// - /// Creates a new binary message with the given body - /// - IBytesMessage CreateBytesMessage(byte[] body); - - - // Transaction methods - - /// - /// If this is a transactional session then commit all message - /// send and acknowledgements for producers and consumers in this session - /// - void Commit(); - - /// - /// If this is a transactional session then rollback all message - /// send and acknowledgements for producers and consumers in this session - /// - void Rollback(); - - } -} + public interface ISession : System.IDisposable + { + + /// + /// Creates a producer of messages + /// + IMessageProducer CreateProducer(); + + /// + /// Creates a producer of messages on a given destination + /// + IMessageProducer CreateProducer(IDestination destination); + + /// + /// Creates a consumer of messages on a given destination + /// + IMessageConsumer CreateConsumer(IDestination destination); + + /// + /// Creates a consumer of messages on a given destination with a selector + /// + IMessageConsumer CreateConsumer(IDestination destination, string selector); + + /// + /// Creates a named durable consumer of messages on a given destination with a selector + /// + IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal); + + /// + /// Returns the queue for the given name + /// + IQueue GetQueue(string name); + + /// + /// Returns the topic for the given name + /// + ITopic GetTopic(string name); + + + /// + /// Creates a temporary queue + /// + ITemporaryQueue CreateTemporaryQueue(); + + /// + /// Creates a temporary topic + /// + ITemporaryTopic CreateTemporaryTopic(); + + + // Factory methods to create messages + + /// + /// Creates a new message with an empty body + /// + IMessage CreateMessage(); + + /// + /// Creates a new text message with an empty body + /// + ITextMessage CreateTextMessage(); + /// + /// Creates a new text message with the given body + /// + ITextMessage CreateTextMessage(string text); + /// + /// Creates a new Map message which contains primitive key and value pairs + /// + IMapMessage CreateMapMessage(); + + /// + /// Creates a new binary message + /// + IBytesMessage CreateBytesMessage(); + + /// + /// Creates a new binary message with the given body + /// + IBytesMessage CreateBytesMessage(byte[] body); + + + // Transaction methods + + /// + /// If this is a transactional session then commit all message + /// send and acknowledgements for producers and consumers in this session + /// + void Commit(); + + /// + /// If this is a transactional session then rollback all message + /// send and acknowledgements for producers and consumers in this session + /// + void Rollback(); + + + + + /// + /// Sets the prefetch size, the maximum number of messages a broker will dispatch to consumers + /// until acknowledgements are received. + /// + int PrefetchSize { get; set; } + + /// + /// Enables or disables whether asynchronous dispatch should be used by the broker + /// + bool DispatchAsync { get; set; } + + /// + /// Enables or disables exclusive consumers when using queues. An exclusive consumer means + /// only one instance of a consumer is allowed to process messages on a queue to preserve order + /// + bool Exclusive { get; set; } + + /// + /// Enables or disables retroactive mode for consumers; i.e. do they go back in time or not? + /// + bool Retroactive { get; set; } + + /// + /// Sets the default consumer priority for consumers + /// + byte Priority { get; set; } + } +}