summaryrefslogtreecommitdiff
path: root/dotnet/Qpid.Messaging
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-06-28 08:09:20 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-06-28 08:09:20 +0000
commit79cd6c772da003ddc917eff362f9adaa99e28b49 (patch)
treebbb1e4b46add9a52f4eb15afe83fb16b5ff6af66 /dotnet/Qpid.Messaging
parente1de334597e23b55c9e91c1f853f52e8313ba103 (diff)
downloadqpid-python-79cd6c772da003ddc917eff362f9adaa99e28b49.tar.gz
Merged revisions 539783-539788 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2 ........ r539783 | tomasr | 2007-05-19 18:40:32 +0100 (Sat, 19 May 2007) | 8 lines * 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 ........ r539788 | tomasr | 2007-05-19 19:55:33 +0100 (Sat, 19 May 2007) | 1 line * Excluded failover tests from nant builds and SSL tests on mono ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@551497 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dotnet/Qpid.Messaging')
-rw-r--r--dotnet/Qpid.Messaging/IMessageConsumer.cs58
-rw-r--r--dotnet/Qpid.Messaging/IMessagePublisher.cs95
2 files changed, 117 insertions, 36 deletions
diff --git a/dotnet/Qpid.Messaging/IMessageConsumer.cs b/dotnet/Qpid.Messaging/IMessageConsumer.cs
index 20e9bd4b38..7767fae995 100644
--- a/dotnet/Qpid.Messaging/IMessageConsumer.cs
+++ b/dotnet/Qpid.Messaging/IMessageConsumer.cs
@@ -22,12 +22,56 @@ 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. Be aware that you can use
+ /// one or the other, but not both at the same time.
+ /// </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);
+ }
}