Skip to content

Commit 692c644

Browse files
committed
Enhance MessageOptions with detailed XML documentation and support for custom properties
1 parent da2c616 commit 692c644

1 file changed

Lines changed: 38 additions & 2 deletions

File tree

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,52 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33

44
namespace Foundatio.Messaging;
55

6+
/// <summary>
7+
/// Represents a message bus that supports both publishing and subscribing to messages.
8+
/// </summary>
69
public interface IMessageBus : IMessagePublisher, IMessageSubscriber, IDisposable
710
{
811
}
912

10-
public class MessageOptions
13+
/// <summary>
14+
/// Options for configuring message publishing behavior.
15+
/// </summary>
16+
public record MessageOptions
1117
{
18+
/// <summary>
19+
/// Gets or sets a unique identifier for the message.
20+
/// Can be used for message deduplication and idempotency checks.
21+
/// </summary>
1222
public string UniqueId { get; set; }
23+
24+
/// <summary>
25+
/// Gets or sets the correlation identifier for distributed tracing.
26+
/// If not set, this is automatically populated from <see cref="System.Diagnostics.Activity.Current"/>
27+
/// when the message is published, enabling end-to-end request tracing across services.
28+
/// </summary>
1329
public string CorrelationId { get; set; }
30+
31+
/// <summary>
32+
/// Gets or sets the delay before the message is delivered to subscribers.
33+
/// <para>
34+
/// Support for delayed delivery varies by provider. Some providers support native delayed delivery
35+
/// where messages are persisted and survive application restarts. Other providers use an in-memory
36+
/// fallback where messages are held in memory until the delay expires.
37+
/// </para>
38+
/// <para>
39+
/// <strong>Warning:</strong> For providers using the in-memory fallback, delayed messages are not persisted
40+
/// and will be lost if the application restarts before the delay expires. Check your provider's
41+
/// documentation for specific behavior.
42+
/// </para>
43+
/// </summary>
1444
public TimeSpan? DeliveryDelay { get; set; }
45+
46+
/// <summary>
47+
/// Gets or sets custom properties to include with the message.
48+
/// These properties are propagated through the message bus and available to subscribers.
49+
/// The mechanism for propagation varies by provider implementation.
50+
/// </summary>
1551
public IDictionary<string, string> Properties { get; set; } = new Dictionary<string, string>();
1652
}

0 commit comments

Comments
 (0)