Skip to content

Commit ded6f51

Browse files
authored
Merge pull request #1201 from ArminShoeibi/feature/add-streams-headers
Add related headers to streams feature in Headers.cs
2 parents 9f08574 + c87f508 commit ded6f51

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public static class Headers
4949

5050
/// <summary>
5151
/// x-max-length header
52+
/// The max total size in bytes
5253
/// </summary>
5354
public const string XMaxLength = "x-max-length";
5455

@@ -96,7 +97,7 @@ public static class Headers
9697
// quorum
9798
/// <summary>
9899
/// x-queue-type header.
99-
/// Available types: "quorum" and "classic"(default)
100+
/// Available types: "quorum" and "classic"(default) and "stream"
100101
/// </summary>
101102
public const string XQueueType = "x-queue-type";
102103

@@ -121,5 +122,29 @@ public static class Headers
121122
/// Allows to configure strategy when <see cref="XMaxLength"/> or <see cref="XMaxLengthInBytes"/> hits limits
122123
/// </summary>
123124
public const string XOverflow = "x-overflow";
125+
126+
/// <summary>
127+
/// x-max-age header
128+
/// Sets the maximum age of the stream. Default: not set.
129+
/// valid units: Y, M, D, h, m, s
130+
/// e.g. 7D for a week
131+
/// </summary>
132+
public const string XMaxAge = "x-max-age";
133+
134+
/// <summary>
135+
/// x-stream-max-segment-size-bytes header
136+
/// A stream is divided up into fixed size segment files on disk.
137+
/// This setting controls the size of these. Default: (500000000 bytes).
138+
/// </summary>
139+
public const string XStreamMaxSegmentSizeInBytes = "x-stream-max-segment-size-bytes";
140+
141+
/// <summary>
142+
/// x-stream-offset header.
143+
/// As streams never delete any messages, any consumer can start reading/consuming from any point in the log.
144+
/// this is controlled by the x-stream-offset consumer argument.
145+
/// Available values: "first", "last", "next", Timestamp and Interval (valid units: Y, M, D, h, m, s)
146+
/// <see href="https://www.rabbitmq.com/streams.html#consuming">See more</see>
147+
/// </summary>
148+
public const string XStreamOffset = "x-stream-offset";
124149
}
125150
}

projects/Unit/APIApproval.Approve.verified.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ namespace RabbitMQ.Client
282282
public const string XDeadLetterExchange = "x-dead-letter-exchange";
283283
public const string XDeadLetterRoutingKey = "x-dead-letter-routing-key";
284284
public const string XExpires = "x-expires";
285+
public const string XMaxAge = "x-max-age";
285286
public const string XMaxLength = "x-max-length";
286287
public const string XMaxLengthInBytes = "x-max-length-bytes";
287288
public const string XMaxPriority = "x-max-priority";
@@ -292,6 +293,8 @@ namespace RabbitMQ.Client
292293
public const string XQueueType = "x-queue-type";
293294
public const string XQuorumInitialGroupSize = "x-quorum-initial-group-size";
294295
public const string XSingleActiveConsumer = "x-single-active-consumer";
296+
public const string XStreamMaxSegmentSizeInBytes = "x-stream-max-segment-size-bytes";
297+
public const string XStreamOffset = "x-stream-offset";
295298
}
296299
public interface IAmqpHeader : RabbitMQ.Client.IAmqpWriteable
297300
{

0 commit comments

Comments
 (0)