Skip to content

Commit 54e11e9

Browse files
Rename header constants
The same header can be used in more than one context, plus this way they are easier to guess.
1 parent dc0e389 commit 54e11e9

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

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

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,50 +54,48 @@ namespace RabbitMQ.Client
5454
public static class Headers
5555
{
5656
/// <summary>
57-
/// Header used to declare priority queues and set maximum priority of a queue
57+
/// x-max-priority header
5858
/// </summary>
59-
public const string QueueMaxPriority = "x-max-priority";
59+
public const string XMaxPriority = "x-max-priority";
6060

6161
/// <summary>
62-
/// Header used to limit maximum length of a queue in messages
62+
/// x-max-length header
6363
/// </summary>
64-
public const string QueueMaxLengthInMessages = "x-max-length";
64+
public const string XMaxLength = "x-max-length";
6565

6666
/// <summary>
67-
/// Header used to limit maximum length of a queue in bytes
67+
/// x-max-length-bytes header
6868
/// </summary>
69-
public const string QueueMaxLengthInBytes = "x-max-length-bytes";
69+
public const string XMaxLengthInBytes = "x-max-length-bytes";
7070

7171
/// <summary>
72-
/// Header used to set dead letter exchange for a queue
72+
/// x-dead-letter-exchange header
7373
/// </summary>
74-
public const string DeadLetterExchange = "x-dead-letter-exchange";
74+
public const string XDeadLetterExchange = "x-dead-letter-exchange";
7575

7676
/// <summary>
77-
/// Header used to set dead letter routing key for a queue
77+
/// x-dead-letter-routing-key header
7878
/// </summary>
79-
public const string DeadLetterRoutingKey = "x-dead-letter-routing-key";
79+
public const string XDeadLetterRoutingKey = "x-dead-letter-routing-key";
8080

8181
/// <summary>
82-
/// Header used to set ttl globaly to all messages in a queue
82+
/// x-message-ttl header
8383
/// </summary>
84-
public const string PerQueueMessageTtl = "x-message-ttl";
84+
public const string XMessageTTL = "x-message-ttl";
8585

8686
/// <summary>
87-
/// Header used to set expiration for a queue
87+
/// x-expires header
8888
/// </summary>
89-
public const string QueueExpires = "x-expires";
90-
89+
public const string XExpires = "x-expires";
9190

9291
/// <summary>
93-
/// Header used to set alternate exchange for an exchange
92+
/// alternate-exchange header
9493
/// </summary>
9594
public const string AlternateExchange = "alternate-exchange";
9695

97-
9896
/// <summary>
99-
/// Header used to set priority of consumer
97+
/// x-priority header
10098
/// </summary>
101-
public const string ConsumerPriority = "x-priority";
99+
public const string XPriority = "x-priority";
102100
}
103101
}

projects/client/Unit/src/unit/TestMessagePatternsSubscription.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected void TestConcurrentIterationWithDrainer(Action<Subscription> action)
5555
{
5656
IDictionary<string, object> args = new Dictionary<string, object>
5757
{
58-
{Headers.PerQueueMessageTtl, 5000}
58+
{Headers.XMessageTTL, 5000}
5959
};
6060
string queueDeclare = Model.QueueDeclare("", false, true, false, args);
6161
var subscription = new Subscription(Model, queueDeclare, false);
@@ -78,7 +78,7 @@ protected void TestSequentialIterationWithDrainer(Action<Subscription> action)
7878
{
7979
IDictionary<string, object> args = new Dictionary<string, object>
8080
{
81-
{Headers.PerQueueMessageTtl, 5000}
81+
{Headers.XMessageTTL, 5000}
8282
};
8383
string queueDeclare = Model.QueueDeclare("", false, true, false, args);
8484
var subscription = new Subscription(Model, queueDeclare, false);

0 commit comments

Comments
 (0)