Skip to content

Commit 8ca6a6f

Browse files
committed
Finish up version 7 release
* Add code XML docs with regard to message body data
1 parent daa5aaa commit 8ca6a6f

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

projects/RabbitMQ.Client/client/api/IAsyncBasicConsumer.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,19 @@ public interface IAsyncBasicConsumer
3636

3737
/// <summary>
3838
/// Called each time a message arrives for this consumer.
39-
/// </summary>
4039
/// <remarks>
41-
/// Does nothing with the passed in information.
42-
/// Note that in particular, some delivered messages may require acknowledgement via <see cref="IChannel.BasicAckAsync"/>.
43-
/// The implementation of this method in this class does NOT acknowledge such messages.
40+
/// <para>
41+
/// Does nothing with the passed in information.
42+
/// Note that in particular, some delivered messages may require acknowledgement via <see cref="IChannel.BasicAckAsync"/>.
43+
/// The implementation of this method in this class does NOT acknowledge such messages.
44+
/// </para>
45+
/// <para>
46+
/// NOTE: Using the <c>body</c> outside of
47+
/// <c><seealso cref="IAsyncBasicConsumer.HandleBasicDeliverAsync(string, ulong, bool, string, string, IReadOnlyBasicProperties, ReadOnlyMemory{byte})"/></c>
48+
/// requires that it be copied!
49+
/// </para>
4450
/// </remarks>
51+
///</summary>
4552
Task HandleBasicDeliverAsync(string consumerTag,
4653
ulong deliveryTag,
4754
bool redelivered,

projects/RabbitMQ.Client/client/events/BasicDeliverEventArgs.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,23 @@ public BasicDeliverEventArgs(string consumerTag,
5959
///<summary>The content header of the message.</summary>
6060
public readonly IReadOnlyBasicProperties BasicProperties;
6161

62-
///<summary>The message body.</summary>
62+
///<summary>
63+
/// <para>
64+
/// The message body as a sequence of bytes.
65+
/// </para>
66+
/// <para>
67+
/// NOTE: Using this memory outside of
68+
/// <c><seealso cref="AsyncEventingBasicConsumer.Received"/></c>
69+
/// requires that it be copied!
70+
/// <example>
71+
/// This shows how to copy the data for use:
72+
/// <code>
73+
/// byte[] bodyCopy = eventArgs.Body.ToArray();
74+
/// // bodyCopy is now safe to use elsewhere
75+
/// </code>
76+
/// </example>
77+
/// </para>
78+
///</summary>
6379
public readonly ReadOnlyMemory<byte> Body;
6480

6581
///<summary>The consumer tag of the consumer that the message

0 commit comments

Comments
 (0)