diff options
| author | Tomas Restrepo <tomasr@apache.org> | 2007-05-19 17:40:32 +0000 |
|---|---|---|
| committer | Tomas Restrepo <tomasr@apache.org> | 2007-05-19 17:40:32 +0000 |
| commit | e075b648784ff38448f706fe75a8adbc635763af (patch) | |
| tree | 9dba8fa76ebb6352355346998b881079662eeba8 /dotnet/Qpid.Messaging | |
| parent | 542d17c5ae4ec10b8a0f863e19952bea66727e06 (diff) | |
| download | qpid-python-e075b648784ff38448f706fe75a8adbc635763af.tar.gz | |
* QPID-495 (Contributed by Carlos Medina) Implement default timeouts for AttainState and SyncWrite
* Fix method signatures
* Remove SSL test with client-side certificates (requires extra setup)
* Add locks AMSQtateManager and AMQProtocolListener to prevent modification of listener collections while processing notifications
* Add library/runtime information to ConnectionStartMethodHandler
* Fix some compiler warnings
* Added XML documentation for some api interfaces
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@539783 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dotnet/Qpid.Messaging')
| -rw-r--r-- | dotnet/Qpid.Messaging/IMessageConsumer.cs | 57 | ||||
| -rw-r--r-- | dotnet/Qpid.Messaging/IMessagePublisher.cs | 95 |
2 files changed, 116 insertions, 36 deletions
diff --git a/dotnet/Qpid.Messaging/IMessageConsumer.cs b/dotnet/Qpid.Messaging/IMessageConsumer.cs index 20e9bd4b38..77e2ee4729 100644 --- a/dotnet/Qpid.Messaging/IMessageConsumer.cs +++ b/dotnet/Qpid.Messaging/IMessageConsumer.cs @@ -22,12 +22,55 @@ using System; namespace Qpid.Messaging { - public interface IMessageConsumer : IDisposable - { - MessageReceivedDelegate OnMessage { get; set; } + /// <summary> + /// Describes an object that can be used to receive (consume) + /// messages from an AMQP queue. + /// </summary> + /// <remarks> + /// Consumers are created using either + /// <see cref="IChannel.CreateConsumer"/> or using + /// the builder pattern (preferred) with + /// <see cref="IChannel.CreateConsumerBuilder"/>. + /// + /// <para> + /// Consumers offer two different ways of receiving messages: + /// You can attach a delegate to the <see cref="OnMessage"/> + /// event and be notified when a message arrives, or you can + /// use the <see cref="Receive"/> and <see cref="ReceiveNoWait"/> + /// methods to control when you receive messages. + /// </para> + /// <para> + /// Regardless of which method you choose, the prefetch settings + /// specified when creating the channel will still control when messages + /// are actually received from the AMQP broker. Any messages that arrive + /// between the prefetch window will be queued by the channel + /// until they can be delivered to the consumer (either though the event + /// or until the consumer actively calls <see cref="Receive"/>). + /// </para> + /// </remarks> + public interface IMessageConsumer : IDisposable + { + /// <summary> + /// Fired when a message is received from the broker by the consumer + /// </summary> + MessageReceivedDelegate OnMessage { get; set; } - IMessage Receive(); - IMessage Receive(long delay); - IMessage ReceiveNoWait(); - } + /// <summary> + /// Wait infinitely for a message to be received from the broker + /// </summary> + /// <returns>The message received</returns> + IMessage Receive(); + /// <summary> + /// Wait the specified time until a message is receive from the broker + /// </summary> + /// <param name="delay">Maximum number of milliseconds to wait for a message</param> + /// <returns>The message received, or null if the timeout expires</returns> + IMessage Receive(long delay); + /// <summary> + /// Return a message if one is already available in the channel. + /// Does not wait for one to be received from the broker. + /// </summary> + /// <returns>The message, if it was available, otherwise null</returns> + IMessage ReceiveNoWait(); + } } diff --git a/dotnet/Qpid.Messaging/IMessagePublisher.cs b/dotnet/Qpid.Messaging/IMessagePublisher.cs index ba9b9a2d14..edba868539 100644 --- a/dotnet/Qpid.Messaging/IMessagePublisher.cs +++ b/dotnet/Qpid.Messaging/IMessagePublisher.cs @@ -22,34 +22,71 @@ using System; namespace Qpid.Messaging { - public interface IMessagePublisher : IDisposable - { - DeliveryMode DeliveryMode { get; set; } - string ExchangeName { get; } - string RoutingKey { get; } - bool DisableMessageID { get; set; } - bool DisableMessageTimestamp { get; set; } - int Priority { get; set; } - long TimeToLive { get; set; } + /// <summary> + /// Defines an object capable of publishing messages + /// to an AMQP broker. + /// </summary> + /// <remarks> + /// A publisher can be created using either + /// <see cref="IChannel.CreatePublisher"/> or + /// using the builder pattern (preferred) with + /// <see cref="IChannel.CreatePublisherBuilder"/> + /// </remarks> + public interface IMessagePublisher : IDisposable + { + /// <summary> + /// Default delivery mode to use with this publisher + /// </summary> + DeliveryMode DeliveryMode { get; set; } + /// <summary> + /// Name of exchange messages are published to + /// </summary> + string ExchangeName { get; } + /// <summary> + /// Routing key used when publishing messages + /// </summary> + string RoutingKey { get; } + /// <summary> + /// If true, a message ID will not be generated by the publisher + /// when sending the message + /// </summary> + bool DisableMessageID { get; set; } + /// <summary> + /// If true, no timestamp will be added to the message + /// when publishing it + /// </summary> + bool DisableMessageTimestamp { get; set; } + /// <summary> + /// Default priority used when publishing messages + /// </summary> + int Priority { get; set; } + /// <summary> + /// Default time to live used when publishing messages + /// </summary> + long TimeToLive { get; set; } + /// <summary> + /// Set the default MIME type for messages produced by this producer. + /// This reduces the overhead of each message. + /// </summary> + string MimeType { get; set; } + /// <summary> + /// Set the default encoding for messages produced by this producer. + /// This reduces the overhead of each message. + /// </summary> + string Encoding { get; set; } - /// <summary> - /// Set the default MIME type for messages produced by this producer. This reduces the overhead of each message. - /// </summary> - /// <param>mimeType</param> - string MimeType - { - set; - } - - /// <summary> - /// Set the default encoding for messages produced by this producer. This reduces the overhead of each message. - /// </summary> - string Encoding - { - set; - } - - void Send(IMessage msg); - void Send(IMessage msg, DeliveryMode deliveryMode, int priority, long timeToLive); - } + /// <summary> + /// Publish a message, using any default values configured + /// </summary> + /// <param name="msg">Message to publish</param> + void Send(IMessage msg); + /// <summary> + /// Publish a message with the specified options + /// </summary> + /// <param name="msg">Message to publish</param> + /// <param name="deliveryMode">Delivery mode to use</param> + /// <param name="priority">Priority of the message</param> + /// <param name="timeToLive">Time to live of the message</param> + void Send(IMessage msg, DeliveryMode deliveryMode, int priority, long timeToLive); + } } |
